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