n = int(input())
k = [int(i) for i in input().split()]
m = 0

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


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

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


print(' '.join(map(str, k)))
print(m)