n=int(input())
a=[int(i) for i in input().split(" ")]
x=0

for i in range(n):
    mi = i
    for j in range(i, n):
        if a[j] < a[mi]:
            mi = j
    
    if i != mi:
        x += 1
        a[i], a[mi] = a[mi] , a[i]

print(" ".join([str(i) for i in a]))
print(x) n=int(input()) n int(input()) int input() input int(i) for i in input().split(" ") for i in input().split(" ") i input().split(" ") ().split () input split " " for i in input().split(" ") int(i) int i a=[int(i) for i in input().split(" ")] a [int(i) for i in input().split(" ")] x=0 x 0 for i in range(n):
    mi = i
    for j in range(i, n):
        if a[j] < a[mi]:
            mi = j
    
    if i != mi:
        x += 1
        a[i], a[mi] = a[mi] , a[i] i range(n) range n mi = i mi i for j in range(i, n):
        if a[j] < a[mi]:
            mi = j
    
     j range(i, n) range i n if a[j] < a[mi]:
            mi = j
    
     a[j] < a[mi] a[j] a j a[mi] a mi mi = j mi j if i != mi:
        x += 1
        a[i], a[mi] = a[mi] , a[i] i != mi i mi x += 1 x 1 a[i], a[mi] = a[mi] , a[i] a[i] a i a[mi] a mi a[mi] a mi a[i] a i str(i) for i in a for i in a i a for i in a str(i) str i print(" ".join([str(i) for i in a])) print " ".join([str(i) for i in a]) " ".join " " join [str(i) for i in a] print(x) print x mi = i i mi x=0 0 x n=int(input()) int(input()) n a=[int(i) for i in input().split(" ")] [int(i) for i in input().split(" ")] a x += 1 1 x mi = j j mi
n=int(input())
a=[int(i) for i in input().split(" ")]
x=0

for i in range(n):
    mi = i
    for j in range(i, n):
        if a[j] < a[mi]:
            mi = j
    
    if i != mi:
        x += 1
        a[i], a[mi] = a[mi] , a[i]

print(" ".join([str(i) for i in a]))
print(x)