data_num = int(input())
data = [int(n) for n in input().split(' ')]
changed = 0

for i in range(0, data_num):
    minj = i
    for j in range(i, data_num):
        if data[j] < data[minj]:
            minj = j
    data[i], data[minj] = data[minj], data[i]
    if i != minj:
        changed += 1

print(' '.join([str(i) for i in data]))
print(changed) data_num = int(input()) data_num int(input()) int 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 data = [int(n) for n in input().split(' ')] data [int(n) for n in input().split(' ')] changed = 0 changed 0 for i in range(0, data_num):
    minj = i
    for j in range(i, data_num):
        if data[j] < data[minj]:
            minj = j
    data[i], data[minj] = data[minj], data[i]
    if i != minj:
        changed += 1 i range(0, data_num) range 0 data_num minj = i minj i for j in range(i, data_num):
        if data[j] < data[minj]:
            minj = j
     j range(i, data_num) range i data_num if data[j] < data[minj]:
            minj = j
     data[j] < data[minj] data[j] data j data[minj] data minj minj = j minj j data[i], data[minj] = data[minj], data[i] data[i] data i data[minj] data minj data[minj] data minj data[i] data i if i != minj:
        changed += 1 i != minj i minj changed += 1 changed 1 str(i) for i in data for i in data i data for i in data str(i) str i print(' '.join([str(i) for i in data])) print ' '.join([str(i) for i in data]) ' '.join ' ' join [str(i) for i in data] print(changed) print changed changed = 0 0 changed minj = j j minj data = [int(n) for n in input().split(' ')] [int(n) for n in input().split(' ')] data changed += 1 1 changed minj = i i minj data_num = int(input()) int(input()) data_num
data_num = int(input())
data = [int(n) for n in input().split(' ')]
changed = 0

for i in range(0, data_num):
    minj = i
    for j in range(i, data_num):
        if data[j] < data[minj]:
            minj = j
    data[i], data[minj] = data[minj], data[i]
    if i != minj:
        changed += 1

print(' '.join([str(i) for i in data]))
print(changed)