n = int(input())

A = list(map(int, input().split()))

cnt = 0

for i in range(n - 1):
    min_i = i
    for j in range(i + 1, n):
        if A[min_i] > A[j]:
            min_i = j
    if min_i != i:
        A[min_i], A[i] = A[i], A[min_i]
        cnt += 1

print(' '.join(map(str, A)))
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 for i in range(n - 1):
    min_i = i
    for j in range(i + 1, n):
        if A[min_i] > A[j]:
            min_i = j
    if min_i != i:
        A[min_i], A[i] = A[i], A[min_i]
        cnt += 1 i range(n - 1) range n - 1 n 1 min_i = i min_i i for j in range(i + 1, n):
        if A[min_i] > A[j]:
            min_i = j
     j range(i + 1, n) range i + 1 i 1 n if A[min_i] > A[j]:
            min_i = j
     A[min_i] > A[j] A[min_i] A min_i A[j] A j min_i = j min_i j if min_i != i:
        A[min_i], A[i] = A[i], A[min_i]
        cnt += 1 min_i != i min_i i A[min_i], A[i] = A[i], A[min_i] A[min_i] A min_i A[i] A i A[i] A i A[min_i] A min_i cnt += 1 cnt 1 print(' '.join(map(str, A))) print ' '.join(map(str, A)) ' '.join ' ' join map(str, A) map str A print(cnt) print cnt min_i = j j min_i n = int(input()) int(input()) n cnt += 1 1 cnt A = list(map(int, input().split())) list(map(int, input().split())) A min_i = i i min_i cnt = 0 0 cnt
n = int(input())

A = list(map(int, input().split()))

cnt = 0

for i in range(n - 1):
    min_i = i
    for j in range(i + 1, n):
        if A[min_i] > A[j]:
            min_i = j
    if min_i != i:
        A[min_i], A[i] = A[i], A[min_i]
        cnt += 1

print(' '.join(map(str, A)))
print(cnt)