N = int(input())
A = list(map(int, input().split()))
cnt = 0
chge = 0
for i in range(N):
    mn = A[i]
    for j in range(i+1, N):
        if mn > A[j]:
            mn = A[j]
            idx = j
            chge = 1
    if chge:
        A[idx] = A[i]
        A[i] = mn
        cnt += 1
        chge = 0

for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print(str(A[i]), end = " ")
print(cnt) 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 cnt = 0 cnt 0 chge = 0 chge 0 for i in range(N):
    mn = A[i]
    for j in range(i+1, N):
        if mn > A[j]:
            mn = A[j]
            idx = j
            chge = 1
    if chge:
        A[idx] = A[i]
        A[i] = mn
        cnt += 1
        chge = 0 i range(N) range N mn = A[i] mn A[i] A i for j in range(i+1, N):
        if mn > A[j]:
            mn = A[j]
            idx = j
            chge = 1
     j range(i+1, N) range i+1 i 1 N if mn > A[j]:
            mn = A[j]
            idx = j
            chge = 1
     mn > A[j] mn A[j] A j mn = A[j] mn A[j] A j idx = j idx j chge = 1 chge 1 if chge:
        A[idx] = A[i]
        A[i] = mn
        cnt += 1
        chge = 0 chge A[idx] = A[i] A[idx] A idx A[i] A i A[i] = mn A[i] A i mn cnt += 1 cnt 1 chge = 0 chge 0 for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print(str(A[i]), end = " ") i range(N) range N if i == N - 1:
        print(A[i])
    else:
        print(str(A[i]), end = " ") i == N - 1 i N - 1 N 1 print(A[i]) print A[i] A i print(str(A[i]), end = " ") print str(A[i]) str A[i] A i end = " " end " " print(cnt) print cnt cnt += 1 1 cnt chge = 0 0 chge idx = j j idx chge = 0 0 chge mn = A[i] A[i] mn A = list(map(int, input().split())) list(map(int, input().split())) A N = int(input()) int(input()) N chge = 1 1 chge cnt = 0 0 cnt mn = A[j] A[j] mn
N = int(input())
A = list(map(int, input().split()))
cnt = 0
chge = 0
for i in range(N):
    mn = A[i]
    for j in range(i+1, N):
        if mn > A[j]:
            mn = A[j]
            idx = j
            chge = 1
    if chge:
        A[idx] = A[i]
        A[i] = mn
        cnt += 1
        chge = 0

for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print(str(A[i]), end = " ")
print(cnt)