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