#!/usr/bin/env python3
N = int(input())
A = list(map(int, input().split()))
c = 0
for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
    A[i], A[minj] = A[minj], A[i]
    if i != minj:
        c += 1

print(' '.join((str(x) for x in A)))
print(c) 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 c = 0 c 0 for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
    A[i], A[minj] = A[minj], A[i]
    if i != minj:
        c += 1 i range(N) range N minj = i minj i for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
     j range(i, N) range i N if A[j] < A[minj]:
            minj = j
     A[j] < A[minj] A[j] A j A[minj] A minj minj = j minj j A[i], A[minj] = A[minj], A[i] A[i] A i A[minj] A minj A[minj] A minj A[i] A i if i != minj:
        c += 1 i != minj i minj c += 1 c 1 str(x) for x in A for x in A x A for x in A str(x) str x print(' '.join((str(x) for x in A))) print ' '.join((str(x) for x in A)) ' '.join ' ' join (str(x) for x in A) print(c) print c A = list(map(int, input().split())) list(map(int, input().split())) A c = 0 0 c minj = i i minj c += 1 1 c N = int(input()) int(input()) N minj = j j minj
#!/usr/bin/env python3
N = int(input())
A = list(map(int, input().split()))
c = 0
for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
    A[i], A[minj] = A[minj], A[i]
    if i != minj:
        c += 1

print(' '.join((str(x) for x in A)))
print(c)