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
    hold = a[i]
    a[i] = a[minj]
    a[minj] = hold
    if(minj != i): count += 1

print(" ".join(list(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
    hold = a[i]
    a[i] = a[minj]
    a[minj] = hold
    if(minj != i): count += 1 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 hold = a[i] hold a[i] a i a[i] = a[minj] a[i] a i a[minj] a minj a[minj] = hold a[minj] a minj hold if(minj != i): count  minj != i minj i print(" ".join(list(map(str, a)))) print " ".join(list(map(str, a))) " ".join " " join list(map(str, a)) list map(str, a) map str a print(count) print count hold = a[i] a[i] hold minj = j j minj N = int(input()) int(input()) N count = 0 0 count minj = i i 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
    hold = a[i]
    a[i] = a[minj]
    a[minj] = hold
    if(minj != i): count += 1

print(" ".join(list(map(str, a))))
print(count)