n = int(input())
m = list(map(int, input().split()))

count = 0
for i in range(n-1):
    minj =i
    for j in range(i+1, n):
        if m[j] < m[minj]:
            minj = j
    if m[i] != m[minj]:
        m[i], m[minj] = m[minj], m[i]
        count += 1


print(" ".join(str(x) for x in m))
print(count) n = int(input()) n int(input()) int input() input m = list(map(int, input().split())) m list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split count = 0 count 0 for i in range(n-1):
    minj =i
    for j in range(i+1, n):
        if m[j] < m[minj]:
            minj = j
    if m[i] != m[minj]:
        m[i], m[minj] = m[minj], m[i]
        count += 1 i range(n-1) range n-1 n 1 minj =i minj i for j in range(i+1, n):
        if m[j] < m[minj]:
            minj = j
     j range(i+1, n) range i+1 i 1 n if m[j] < m[minj]:
            minj = j
     m[j] < m[minj] m[j] m j m[minj] m minj minj = j minj j if m[i] != m[minj]:
        m[i], m[minj] = m[minj], m[i]
        count += 1 m[i] != m[minj] m[i] m i m[minj] m minj m[i], m[minj] = m[minj], m[i] m[i] m i m[minj] m minj m[minj] m minj m[i] m i count += 1 count 1 print(" ".join(str(x) for x in m)) print " ".join(str(x) for x in m) " ".join " " join str(x) str x print(count) print count n = int(input()) int(input()) n minj =i i minj m = list(map(int, input().split())) list(map(int, input().split())) m count = 0 0 count count += 1 1 count minj = j j minj
n = int(input())
m = list(map(int, input().split()))

count = 0
for i in range(n-1):
    minj =i
    for j in range(i+1, n):
        if m[j] < m[minj]:
            minj = j
    if m[i] != m[minj]:
        m[i], m[minj] = m[minj], m[i]
        count += 1


print(" ".join(str(x) for x in m))
print(count)