N = int(input())
S = list(map(int, input().split(" ")))
Exchange_Number_of_times = 0
for i in range(N):
    minj = i
    for j in range(i, N):
        if S[j] < S[minj]:
            minj = j
    if i != minj:
        S[i], S[minj] = S[minj], S[i]
        Exchange_Number_of_times += 1
print(' '.join(map(str,S)))
print(Exchange_Number_of_times)
 N = int(input()) N int(input()) int input() input S = list(map(int, input().split(" "))) S list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " Exchange_Number_of_times = 0 Exchange_Number_of_times 0 for i in range(N):
    minj = i
    for j in range(i, N):
        if S[j] < S[minj]:
            minj = j
    if i != minj:
        S[i], S[minj] = S[minj], S[i]
        Exchange_Number_of_times += 1 i range(N) range N minj = i minj i for j in range(i, N):
        if S[j] < S[minj]:
            minj = j
     j range(i, N) range i N if S[j] < S[minj]:
            minj = j
     S[j] < S[minj] S[j] S j S[minj] S minj minj = j minj j if i != minj:
        S[i], S[minj] = S[minj], S[i]
        Exchange_Number_of_times += 1 i != minj i minj S[i], S[minj] = S[minj], S[i] S[i] S i S[minj] S minj S[minj] S minj S[i] S i Exchange_Number_of_times += 1 Exchange_Number_of_times 1 print(' '.join(map(str,S))) print ' '.join(map(str,S)) ' '.join ' ' join map(str,S) map str S print(Exchange_Number_of_times) print Exchange_Number_of_times Exchange_Number_of_times = 0 0 Exchange_Number_of_times Exchange_Number_of_times += 1 1 Exchange_Number_of_times N = int(input()) int(input()) N minj = i i minj minj = j j minj S = list(map(int, input().split(" "))) list(map(int, input().split(" "))) S
N = int(input())
S = list(map(int, input().split(" ")))
Exchange_Number_of_times = 0
for i in range(N):
    minj = i
    for j in range(i, N):
        if S[j] < S[minj]:
            minj = j
    if i != minj:
        S[i], S[minj] = S[minj], S[i]
        Exchange_Number_of_times += 1
print(' '.join(map(str,S)))
print(Exchange_Number_of_times)

