N = int(raw_input())
A = map(int, raw_input().split())
count = 0
for i in range(0, N):
    min_j = i
    c = 0
    for j in range(i, N):
        if A[j] < A[min_j]:
            min_j = j
            c = 1
    A[i], A[min_j] = A[min_j], A[i]
    count += c
print " ".join(map(str, A))
print count N = int(raw_input()) N int(raw_input()) int raw_input() raw_input A = map(int, raw_input().split()) A map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split count = 0 count 0 for i in range(0, N):
    min_j = i
    c = 0
    for j in range(i, N):
        if A[j] < A[min_j]:
            min_j = j
            c = 1
    A[i], A[min_j] = A[min_j], A[i]
    count += c i range(0, N) range 0 N min_j = i min_j i c = 0 c 0 for j in range(i, N):
        if A[j] < A[min_j]:
            min_j = j
            c = 1
     j range(i, N) range i N if A[j] < A[min_j]:
            min_j = j
            c = 1
     A[j] < A[min_j] A[j] A j A[min_j] A min_j min_j = j min_j j c = 1 c 1 A[i], A[min_j] = A[min_j], A[i] A[i] A i A[min_j] A min_j A[min_j] A min_j A[i] A i count += c count c print " ".join(map(str, A)) " ".join " " join map(str, A) map str A print min_j = i i min_j c = 0 0 c N = int(raw_input()) int(raw_input()) N count = 0 0 count A = map(int, raw_input().split()) map(int, raw_input().split()) A c = 1 1 c min_j = j j min_j count += c c count
N = int(raw_input())
A = map(int, raw_input().split())
count = 0
for i in range(0, N):
    min_j = i
    c = 0
    for j in range(i, N):
        if A[j] < A[min_j]:
            min_j = j
            c = 1
    A[i], A[min_j] = A[min_j], A[i]
    count += c
print " ".join(map(str, A))
print count