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