n = int(input())
A = list(map(int,input().split()))
count = 0

for i in range(n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        count += 1
        a = A[i]
        A[i] = A[minj]
        A[minj] = a

print(' '.join(map(str,A)))
print(count) n = int(input()) n int(input()) int input() input A = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split count = 0 count 0 for i in range(n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        count += 1
        a = A[i]
        A[i] = A[minj]
        A[minj] = a i range(n) range n minj = i minj i for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
     j range(i,n) range i n if A[j] < A[minj]:
            minj = j
     A[j] < A[minj] A[j] A j A[minj] A minj minj = j minj j if minj != i:
        count += 1
        a = A[i]
        A[i] = A[minj]
        A[minj] = a minj != i minj i count += 1 count 1 a = A[i] a A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = a A[minj] A minj a print(' '.join(map(str,A))) print ' '.join(map(str,A)) ' '.join ' ' join map(str,A) map str A print(count) print count count += 1 1 count n = int(input()) int(input()) n a = A[i] A[i] a count = 0 0 count minj = i i minj minj = j j minj A = list(map(int,input().split())) list(map(int,input().split())) A
n = int(input())
A = list(map(int,input().split()))
count = 0

for i in range(n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        count += 1
        a = A[i]
        A[i] = A[minj]
        A[minj] = a

print(' '.join(map(str,A)))
print(count)
