N = int(raw_input())
A = raw_input().split(" ")

count = 0
for i in range(0, N):
    minj = i
    for j in range(i, N):
        if int(A[j]) < int(A[minj]):
            minj = j

    if i != minj:
        temp = A[i]
        A[i] = A[minj]
        A[minj] = temp
        count += 1

print " ".join(A)
print count N = int(raw_input()) N int(raw_input()) int raw_input() raw_input A = raw_input().split(" ") A raw_input().split(" ") ().split () raw_input split " " count = 0 count 0 for i in range(0, N):
    minj = i
    for j in range(i, N):
        if int(A[j]) < int(A[minj]):
            minj = j

    if i != minj:
        temp = A[i]
        A[i] = A[minj]
        A[minj] = temp
        count += 1 i range(0, N) range 0 N minj = i minj i for j in range(i, N):
        if int(A[j]) < int(A[minj]):
            minj = j

     j range(i, N) range i N if int(A[j]) < int(A[minj]):
            minj = j

     int(A[j]) < int(A[minj]) int(A[j]) int A[j] A j int(A[minj]) int A[minj] A minj minj = j minj j if i != minj:
        temp = A[i]
        A[i] = A[minj]
        A[minj] = temp
        count += 1 i != minj i minj temp = A[i] temp A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = temp A[minj] A minj temp count += 1 count 1 print " ".join(A) " ".join " " join A print A = raw_input().split(" ") raw_input().split(" ") A temp = A[i] A[i] temp count += 1 1 count minj = i i minj count = 0 0 count minj = j j minj N = int(raw_input()) int(raw_input()) N
N = int(raw_input())
A = raw_input().split(" ")

count = 0
for i in range(0, N):
    minj = i
    for j in range(i, N):
        if int(A[j]) < int(A[minj]):
            minj = j

    if i != minj:
        temp = A[i]
        A[i] = A[minj]
        A[minj] = temp
        count += 1

print " ".join(A)
print count