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