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