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

nb_exchange = 0
for i in range(n):
    minj = i
    for j in range(i, n):
        if data[j] < data[minj]:
            minj = j

    if i != minj:
        nb_exchange += 1
        data[i], data[minj] = data[minj], data[i]

print(" ".join(map(str, data)))
print(nb_exchange) n = int(input()) n int(input()) int input() input data = list(map(int, input().split())) data list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split nb_exchange = 0 nb_exchange 0 for i in range(n):
    minj = i
    for j in range(i, n):
        if data[j] < data[minj]:
            minj = j

    if i != minj:
        nb_exchange += 1
        data[i], data[minj] = data[minj], data[i] i range(n) range n minj = i minj i for j in range(i, n):
        if data[j] < data[minj]:
            minj = j

     j range(i, n) range i n if data[j] < data[minj]:
            minj = j

     data[j] < data[minj] data[j] data j data[minj] data minj minj = j minj j if i != minj:
        nb_exchange += 1
        data[i], data[minj] = data[minj], data[i] i != minj i minj nb_exchange += 1 nb_exchange 1 data[i], data[minj] = data[minj], data[i] data[i] data i data[minj] data minj data[minj] data minj data[i] data i print(" ".join(map(str, data))) print " ".join(map(str, data)) " ".join " " join map(str, data) map str data print(nb_exchange) print nb_exchange nb_exchange += 1 1 nb_exchange minj = j j minj nb_exchange = 0 0 nb_exchange data = list(map(int, input().split())) list(map(int, input().split())) data minj = i i minj n = int(input()) int(input()) n
n = int(input())
data = list(map(int, input().split()))

nb_exchange = 0
for i in range(n):
    minj = i
    for j in range(i, n):
        if data[j] < data[minj]:
            minj = j

    if i != minj:
        nb_exchange += 1
        data[i], data[minj] = data[minj], data[i]

print(" ".join(map(str, data)))
print(nb_exchange)