n = int(input())
a = list(map(int, input().split()))
count = 0

for i in range(n-1):
    min_j = i
    for j in range(i+1, n):
        if a[j] < a[min_j]:
            min_j = j
    if min_j != i:
        a[i], a[min_j] = a[min_j], a[i]
        count += 1

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

for i in range(n-1):
    min_j = i
    for j in range(i+1, n):
        if a[j] < a[min_j]:
            min_j = j
    if min_j != i:
        a[i], a[min_j] = a[min_j], a[i]
        count += 1

print(*a)
print(count)
