
N = (int)(input())
A = list(map(int,input().split()))

swapOperation = 0

for i in range(0,N):
    minj = i
    for j in range(i,N):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        v = A[i]
        A[i] = A[minj]
        A[minj] = v
        swapOperation += 1

print(' '.join(map(str,A)))
print(swapOperation) 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 swapOperation = 0 swapOperation 0 for i in range(0,N):
    minj = i
    for j in range(i,N):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        v = A[i]
        A[i] = A[minj]
        A[minj] = v
        swapOperation += 1 i range(0,N) range 0 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:
        v = A[i]
        A[i] = A[minj]
        A[minj] = v
        swapOperation += 1 minj != i minj i v = A[i] v A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = v A[minj] A minj v swapOperation += 1 swapOperation 1 print(' '.join(map(str,A))) print ' '.join(map(str,A)) ' '.join ' ' join map(str,A) map str A print(swapOperation) print swapOperation swapOperation += 1 1 swapOperation A = list(map(int,input().split())) list(map(int,input().split())) A minj = j j minj N = (int)(input()) (int)(input()) N swapOperation = 0 0 swapOperation minj = i i minj v = A[i] A[i] v

N = (int)(input())
A = list(map(int,input().split()))

swapOperation = 0

for i in range(0,N):
    minj = i
    for j in range(i,N):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        v = A[i]
        A[i] = A[minj]
        A[minj] = v
        swapOperation += 1

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