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

counter = 0

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

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

counter = 0

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

print(*A)
print(counter)

