n = int(input())
arrey = [int(i) for i in input().split()]
count = 0

for i in range(len(arrey)):
    minj = i
    change = False
    for j in range(i+1, len(arrey)):
        if arrey[minj] > arrey[j]:
            minj = j
            change = True
    if change:
        arrey[i], arrey[minj] = arrey[minj], arrey[i]
        count += 1

for i in range(len(arrey)):
    print(str(arrey[i])+' ',end='') if i != len(arrey)-1 else print(arrey[i])
print(count) 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 arrey = [int(i) for i in input().split()] arrey [int(i) for i in input().split()] count = 0 count 0 for i in range(len(arrey)):
    minj = i
    change = False
    for j in range(i+1, len(arrey)):
        if arrey[minj] > arrey[j]:
            minj = j
            change = True
    if change:
        arrey[i], arrey[minj] = arrey[minj], arrey[i]
        count += 1 i range(len(arrey)) range len(arrey) len arrey minj = i minj i change = False change False for j in range(i+1, len(arrey)):
        if arrey[minj] > arrey[j]:
            minj = j
            change = True
     j range(i+1, len(arrey)) range i+1 i 1 len(arrey) len arrey if arrey[minj] > arrey[j]:
            minj = j
            change = True
     arrey[minj] > arrey[j] arrey[minj] arrey minj arrey[j] arrey j minj = j minj j change = True change True if change:
        arrey[i], arrey[minj] = arrey[minj], arrey[i]
        count += 1 change arrey[i], arrey[minj] = arrey[minj], arrey[i] arrey[i] arrey i arrey[minj] arrey minj arrey[minj] arrey minj arrey[i] arrey i count += 1 count 1 for i in range(len(arrey)):
    print(str(arrey[i])+' ',end='') if i != len(arrey)-1 else print(arrey[i]) i range(len(arrey)) range len(arrey) len arrey print(str(arrey[i])+' ',end='') if i != len(arrey)-1 else print(arrey[i]) i != len(arrey)-1 i len(arrey)-1 len(arrey) len arrey 1 print(str(arrey[i])+' ',end='') print str(arrey[i])+' ' str(arrey[i]) str arrey[i] arrey i ' ' end='' end '' print(arrey[i]) print arrey[i] arrey i print(count) print count count += 1 1 count n = int(input()) int(input()) n change = False False change count = 0 0 count minj = i i minj arrey = [int(i) for i in input().split()] [int(i) for i in input().split()] arrey minj = j j minj change = True True change
n = int(input())
arrey = [int(i) for i in input().split()]
count = 0

for i in range(len(arrey)):
    minj = i
    change = False
    for j in range(i+1, len(arrey)):
        if arrey[minj] > arrey[j]:
            minj = j
            change = True
    if change:
        arrey[i], arrey[minj] = arrey[minj], arrey[i]
        count += 1

for i in range(len(arrey)):
    print(str(arrey[i])+' ',end='') if i != len(arrey)-1 else print(arrey[i])
print(count)