N=int(input())
A=[int(i) for i in input().split()]
C=0
for i in range(N):
    minj=i
    for j in range(i,N):
        if A[j]<A[minj]:
            minj=j
    if i!=minj:
        t=A[i]
        A[i]=A[minj]
        A[minj]=t
        C+=1
 #   print(minj)
for i in range(N):
    A[i]=str(A[i])
print(" ".join(A))
print(C) N=int(input()) N int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i A=[int(i) for i in input().split()] A [int(i) for i in input().split()] C=0 C 0 for i in range(N):
    minj=i
    for j in range(i,N):
        if A[j]<A[minj]:
            minj=j
    if i!=minj:
        t=A[i]
        A[i]=A[minj]
        A[minj]=t
        C+=1
 #   print(minj) 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 i!=minj:
        t=A[i]
        A[i]=A[minj]
        A[minj]=t
        C+=1
 #   print(minj) i!=minj i minj t=A[i] t A[i] A i A[i]=A[minj] A[i] A i A[minj] A minj A[minj]=t A[minj] A minj t C+=1 C 1 for i in range(N):
    A[i]=str(A[i]) i range(N) range N A[i]=str(A[i]) A[i] A i str(A[i]) str A[i] A i print(" ".join(A)) print " ".join(A) " ".join " " join A print(C) print C minj=j j minj t=A[i] A[i] t C=0 0 C minj=i i minj C+=1 1 C N=int(input()) int(input()) N A=[int(i) for i in input().split()] [int(i) for i in input().split()] A
N=int(input())
A=[int(i) for i in input().split()]
C=0
for i in range(N):
    minj=i
    for j in range(i,N):
        if A[j]<A[minj]:
            minj=j
    if i!=minj:
        t=A[i]
        A[i]=A[minj]
        A[minj]=t
        C+=1
 #   print(minj)
for i in range(N):
    A[i]=str(A[i])
print(" ".join(A))
print(C)