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

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

for i in range(n):
    minj = i
    for j in range(i, n):
        if A[j] < A[minj]:
            minj = j
        else:
            pass
    A[i], A[minj] = A[minj], A[i]
    if i != minj:
        count += 1
        
print(*A)
print(count)
