n = int(input())
a = list(map(int,input().split()))
count = 0
for i in range(n-1):
    flag = 0
    min_j = i
    for j in range(i,n):
        if a[j] < a[min_j]:
            min_j = j
            flag = 1
    if flag:
        a[i], a[min_j] = a[min_j], a[i]
        count += 1
print(" ".join(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-1):
    flag = 0
    min_j = i
    for j in range(i,n):
        if a[j] < a[min_j]:
            min_j = j
            flag = 1
    if flag:
        a[i], a[min_j] = a[min_j], a[i]
        count += 1 i range(n-1) range n-1 n 1 flag = 0 flag 0 min_j = i min_j i for j in range(i,n):
        if a[j] < a[min_j]:
            min_j = j
            flag = 1
     j range(i,n) range i n if a[j] < a[min_j]:
            min_j = j
            flag = 1
     a[j] < a[min_j] a[j] a j a[min_j] a min_j min_j = j min_j j flag = 1 flag 1 if flag:
        a[i], a[min_j] = a[min_j], a[i]
        count += 1 flag a[i], a[min_j] = a[min_j], a[i] a[i] a i a[min_j] a min_j a[min_j] a min_j a[i] a i count += 1 count 1 print(" ".join(map(str,a))) print " ".join(map(str,a)) " ".join " " join map(str,a) map str a print(count) print count flag = 0 0 flag count = 0 0 count count += 1 1 count min_j = i i min_j min_j = j j min_j flag = 1 1 flag n = int(input()) int(input()) n 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-1):
    flag = 0
    min_j = i
    for j in range(i,n):
        if a[j] < a[min_j]:
            min_j = j
            flag = 1
    if flag:
        a[i], a[min_j] = a[min_j], a[i]
        count += 1
print(" ".join(map(str,a)))
print(count)