n = int(input())
a = list(map(int, input().split()))

swap_count = 0
for i in range(n):
    flag = False
    minj = i
    for j in range(i, n):
        if a[j] < a[minj]:
            minj = j
            flag = True
    if flag:
        a[i], a[minj] = a[minj], a[i]
        swap_count += 1

print(' '.join(map(str, a)))
print(swap_count)
 n = int(input()) n int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split swap_count = 0 swap_count 0 for i in range(n):
    flag = False
    minj = i
    for j in range(i, n):
        if a[j] < a[minj]:
            minj = j
            flag = True
    if flag:
        a[i], a[minj] = a[minj], a[i]
        swap_count += 1 i range(n) range n flag = False flag False minj = i minj i for j in range(i, n):
        if a[j] < a[minj]:
            minj = j
            flag = True
     j range(i, n) range i n if a[j] < a[minj]:
            minj = j
            flag = True
     a[j] < a[minj] a[j] a j a[minj] a minj minj = j minj j flag = True flag True if flag:
        a[i], a[minj] = a[minj], a[i]
        swap_count += 1 flag a[i], a[minj] = a[minj], a[i] a[i] a i a[minj] a minj a[minj] a minj a[i] a i swap_count += 1 swap_count 1 print(' '.join(map(str, a))) print ' '.join(map(str, a)) ' '.join ' ' join map(str, a) map str a print(swap_count) print swap_count swap_count = 0 0 swap_count swap_count += 1 1 swap_count flag = True True flag a = list(map(int, input().split())) list(map(int, input().split())) a minj = i i minj flag = False False flag n = int(input()) int(input()) n minj = j j minj
n = int(input())
a = list(map(int, input().split()))

swap_count = 0
for i in range(n):
    flag = False
    minj = i
    for j in range(i, n):
        if a[j] < a[minj]:
            minj = j
            flag = True
    if flag:
        a[i], a[minj] = a[minj], a[i]
        swap_count += 1

print(' '.join(map(str, a)))
print(swap_count)

