n = int(raw_input())
a = map(int, raw_input().split())

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

for i in range(n):
    if i == n-1:
        print a[i]
    else:
        print a[i],

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(n):
    minj = i
    for j in range(i, n):
        if a[j] < a[minj]:
            minj = j
            
    if a[i] != a[minj]:
        tmp = a[i]
        a[i] = a[minj]
        a[minj] = tmp
        count += 1 i range(n) range n minj = i minj i for j in range(i, n):
        if a[j] < a[minj]:
            minj = j
            
     j range(i, n) range 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 a[i] != a[minj]:
        tmp = a[i]
        a[i] = a[minj]
        a[minj] = tmp
        count += 1 a[i] != a[minj] a[i] a i a[minj] a minj tmp = a[i] tmp a[i] a i a[i] = a[minj] a[i] a i a[minj] a minj a[minj] = tmp a[minj] a minj tmp count += 1 count 1 for i in range(n):
    if i == n-1:
        print a[i]
    else:
        print a[i], i range(n) range n if i == n-1:
        print a[i]
    else:
        print a[i], i == n-1 i n-1 n 1 print a[i] a i print a[i] a i print tmp = a[i] a[i] tmp a = map(int, raw_input().split()) map(int, raw_input().split()) a minj = i i minj count += 1 1 count count = 0 0 count minj = j j minj n = int(raw_input()) int(raw_input()) n
n = int(raw_input())
a = map(int, raw_input().split())

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

for i in range(n):
    if i == n-1:
        print a[i]
    else:
        print a[i],

print count