p = int(input())
y = list(map(int, input().split()))
t = 0
for h in range(p):
    o = h
    for n in range(h, p):
        if y[n] < y[o]: o = n
    if h != o:
        y[h], y[o] = y[o], y[h]
        t += 1
print(*y)
print(t) p = int(input()) p int(input()) int input() input y = list(map(int, input().split())) y list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split t = 0 t 0 for h in range(p):
    o = h
    for n in range(h, p):
        if y[n] < y[o]: o = n
    if h != o:
        y[h], y[o] = y[o], y[h]
        t += 1 h range(p) range p o = h o h for n in range(h, p):
        if y[n] < y[o]: o = n
     n range(h, p) range h p if y[n] < y[o]: o = n
     y[n] < y[o] y[n] y n y[o] y o if h != o:
        y[h], y[o] = y[o], y[h]
        t += 1 h != o h o y[h], y[o] = y[o], y[h] y[h] y h y[o] y o y[o] y o y[h] y h t += 1 t 1 print(*y) print *y y print(t) print t t += 1 1 t y = list(map(int, input().split())) list(map(int, input().split())) y o = h h o t = 0 0 t p = int(input()) int(input()) p
p = int(input())
y = list(map(int, input().split()))
t = 0
for h in range(p):
    o = h
    for n in range(h, p):
        if y[n] < y[o]: o = n
    if h != o:
        y[h], y[o] = y[o], y[h]
        t += 1
print(*y)
print(t)