N = int(input())
A = [int(i) for i in 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 A[i] != A[minj]:
        A[i], A[minj] = A[minj], A[i]
        counter += 1

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

print(' '.join([str(A[i]) for i in range(N)]))
print(counter)