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