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

count = 0

for i in range(N):
    minj = i
    for j in range(i, N, 1):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        A[i], A[minj] = A[minj], A[i]
        count += 1

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

count = 0

for i in range(N):
    minj = i
    for j in range(i, N, 1):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        A[i], A[minj] = A[minj], A[i]
        count += 1

print(" ".join(map(str, A)))
print(count)

