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