n=int(input())
l=list(map(int,input().split()))

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

counter=0
for i in range(n):
    minimum=i
    for j in range(i,n):
        if l[minimum]>l[j]:
            minimum=j
    if i!=minimum:
        l[minimum],l[i]=l[i],l[minimum]
        counter+=1
print(*l)
print(counter)