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

for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
    if i is not minj:
        A[i], A[minj] = A[minj], A[i]
        cnt += 1

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

for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
    if i is not minj:
        A[i], A[minj] = A[minj], A[i]
        cnt += 1

print(' '.join(map(str, A)))
print(cnt)