n = int(input())
A = 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:
        (A[i], A[minj]) = (A[minj], A[i])
        count += 1

print(" ".join(A))
print(count) n = int(input()) n int(input()) int input() input A = input().split(' ') A input().split(' ') ().split () 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:
        (A[i], A[minj]) = (A[minj], A[i])
        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:
        (A[i], A[minj]) = (A[minj], A[i])
        count += 1 i != minj i minj (A[i], A[minj]) = (A[minj], A[i]) (A[i], A[minj]) A[i] A i A[minj] A minj (A[minj], A[i]) A[minj] A minj A[i] A i count += 1 count 1 print(" ".join(A)) print " ".join(A) " ".join " " join A print(count) print count count += 1 1 count count = 0 0 count minj = j j minj minj = i i minj n = int(input()) int(input()) n A = input().split(' ') input().split(' ') A
n = int(input())
A = 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:
        (A[i], A[minj]) = (A[minj], A[i])
        count += 1

print(" ".join(A))
print(count)