N = int(input())
A = list(map(int, input().split(" ")))
num_of_swp = 0

for i in range(N):
  mini = i

  for j in range(i + 1, N):
    if A[j] < A[mini]: mini = j

  if i != mini:
    A[i], A[mini] = A[mini], A[i]
    num_of_swp += 1

print(" ".join(map(str, A)))
print(num_of_swp) 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 " " num_of_swp = 0 num_of_swp 0 for i in range(N):
  mini = i

  for j in range(i + 1, N):
    if A[j] < A[mini]: mini = j

  if i != mini:
    A[i], A[mini] = A[mini], A[i]
    num_of_swp += 1 i range(N) range N mini = i mini i for j in range(i + 1, N):
    if A[j] < A[mini]: mini = j

   j range(i + 1, N) range i + 1 i 1 N if A[j] < A[mini]: mini = j

   A[j] < A[mini] A[j] A j A[mini] A mini if i != mini:
    A[i], A[mini] = A[mini], A[i]
    num_of_swp += 1 i != mini i mini A[i], A[mini] = A[mini], A[i] A[i] A i A[mini] A mini A[mini] A mini A[i] A i num_of_swp += 1 num_of_swp 1 print(" ".join(map(str, A))) print " ".join(map(str, A)) " ".join " " join map(str, A) map str A print(num_of_swp) print num_of_swp mini = i i mini num_of_swp += 1 1 num_of_swp A = list(map(int, input().split(" "))) list(map(int, input().split(" "))) A N = int(input()) int(input()) N num_of_swp = 0 0 num_of_swp
N = int(input())
A = list(map(int, input().split(" ")))
num_of_swp = 0

for i in range(N):
  mini = i

  for j in range(i + 1, N):
    if A[j] < A[mini]: mini = j

  if i != mini:
    A[i], A[mini] = A[mini], A[i]
    num_of_swp += 1

print(" ".join(map(str, A)))
print(num_of_swp)