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