n = int(input())
L = list(map(int, input().split()))
p = 0
for i in range(n):
    minj = i
    for j in range(i, n):
        if L[j] < L[minj]:
            minj = j
    if i != minj: 
        L[i], L[minj] = L[minj], L[i]
        p += 1

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

print(*L)
print(p)