n, data = int(input()), list(map(int, input().split()))
idx, t = 0, 0
for i in range(n-1):
    for j in range(i, n):
        if j == i:
            idx = j
        elif data[idx] > data[j]:
            idx = j
    if data[i] > data[idx]:
        data[i], data[idx] = data[idx], data[i]
        t += 1
print(" ".join(map(str, data)))
print(t)
 n, data = int(input()), list(map(int, input().split())) n int(input()) int input() input data list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split idx, t = 0, 0 idx 0 t 0 for i in range(n-1):
    for j in range(i, n):
        if j == i:
            idx = j
        elif data[idx] > data[j]:
            idx = j
    if data[i] > data[idx]:
        data[i], data[idx] = data[idx], data[i]
        t += 1 i range(n-1) range n-1 n 1 for j in range(i, n):
        if j == i:
            idx = j
        elif data[idx] > data[j]:
            idx = j
     j range(i, n) range i n if j == i:
            idx = j
        elif data[idx] > data[j]:
            idx = j
     j == i j i idx = j idx j elif data[idx] > data[j]:
            idx = j
     data[idx] > data[j] data[idx] data idx data[j] data j idx = j idx j if data[i] > data[idx]:
        data[i], data[idx] = data[idx], data[i]
        t += 1 data[i] > data[idx] data[i] data i data[idx] data idx data[i], data[idx] = data[idx], data[i] data[i] data i data[idx] data idx data[idx] data idx data[i] data i t += 1 t 1 print(" ".join(map(str, data))) print " ".join(map(str, data)) " ".join " " join map(str, data) map str data print(t) print t idx = j j idx t += 1 1 t idx, t = 0, 0 0 idx n, data = int(input()), list(map(int, input().split())) int(input()) n data = int(input()), list(map(int, input().split())) list(map(int, input().split())) data idx = j j idx t = 0, 0 0 t
n, data = int(input()), list(map(int, input().split()))
idx, t = 0, 0
for i in range(n-1):
    for j in range(i, n):
        if j == i:
            idx = j
        elif data[idx] > data[j]:
            idx = j
    if data[i] > data[idx]:
        data[i], data[idx] = data[idx], data[i]
        t += 1
print(" ".join(map(str, data)))
print(t)

