cnt = 0
n = int(input())
lst = list(map(int, input().split()))
for i in range(n):
    m = i
    for j in range(i, n):
        if lst[j] < lst[m]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt += 1
print(*lst)
print(cnt) cnt = 0 cnt 0 n = int(input()) n int(input()) int input() input lst = list(map(int, input().split())) lst list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(n):
    m = i
    for j in range(i, n):
        if lst[j] < lst[m]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt += 1 i range(n) range n m = i m i for j in range(i, n):
        if lst[j] < lst[m]:
            m = j
     j range(i, n) range i n if lst[j] < lst[m]:
            m = j
     lst[j] < lst[m] lst[j] lst j lst[m] lst m m = j m j if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt += 1 m != i m i lst[i], lst[m] = lst[m], lst[i] lst[i] lst i lst[m] lst m lst[m] lst m lst[i] lst i cnt += 1 cnt 1 print(*lst) print *lst lst print(cnt) print cnt m = j j m n = int(input()) int(input()) n lst = list(map(int, input().split())) list(map(int, input().split())) lst cnt += 1 1 cnt m = i i m cnt = 0 0 cnt
cnt = 0
n = int(input())
lst = list(map(int, input().split()))
for i in range(n):
    m = i
    for j in range(i, n):
        if lst[j] < lst[m]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt += 1
print(*lst)
print(cnt)