count = 0
input()
num = [int(n) for n in input().split()]
for i in range(len(num)):
    minj = i
    for j in range(i, len(num)):
        if num[j] < num[minj]:
            minj = j
    if minj != i:
        num[i], num[minj] = num[minj], num[i]
        count += 1
print(*num)
print(count) count = 0 count 0 input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n num = [int(n) for n in input().split()] num [int(n) for n in input().split()] for i in range(len(num)):
    minj = i
    for j in range(i, len(num)):
        if num[j] < num[minj]:
            minj = j
    if minj != i:
        num[i], num[minj] = num[minj], num[i]
        count += 1 i range(len(num)) range len(num) len num minj = i minj i for j in range(i, len(num)):
        if num[j] < num[minj]:
            minj = j
     j range(i, len(num)) range i len(num) len num if num[j] < num[minj]:
            minj = j
     num[j] < num[minj] num[j] num j num[minj] num minj minj = j minj j if minj != i:
        num[i], num[minj] = num[minj], num[i]
        count += 1 minj != i minj i num[i], num[minj] = num[minj], num[i] num[i] num i num[minj] num minj num[minj] num minj num[i] num i count += 1 count 1 print(*num) print *num num print(count) print count count += 1 1 count minj = i i minj minj = j j minj num = [int(n) for n in input().split()] [int(n) for n in input().split()] num count = 0 0 count
count = 0
input()
num = [int(n) for n in input().split()]
for i in range(len(num)):
    minj = i
    for j in range(i, len(num)):
        if num[j] < num[minj]:
            minj = j
    if minj != i:
        num[i], num[minj] = num[minj], num[i]
        count += 1
print(*num)
print(count)