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

def selectSort(A, N):
 sw = 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[i], A[minj] = A[minj], A[i]
   sw += 1
 return str(sw)

sw = selectSort(A, N)
print(" ".join(map(str, A)))
print(sw) 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 def selectSort(A, N):
 sw = 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[i], A[minj] = A[minj], A[i]
   sw += 1
 return str(sw) selectSort sw = 0 sw 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[i], A[minj] = A[minj], A[i]
   sw += 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[i], A[minj] = A[minj], A[i]
   sw += 1
  A[i] != A[minj] A[i] A i A[minj] A minj A[i], A[minj] = A[minj], A[i] A[i] A i A[minj] A minj A[minj] A minj A[i] A i sw += 1 sw 1 return str(sw) str(sw) str sw A A N N sw = selectSort(A, N) sw selectSort(A, N) selectSort A N print(" ".join(map(str, A))) print " ".join(map(str, A)) " ".join " " join map(str, A) map str A print(sw) print sw sw = selectSort(A, N) selectSort(A, N) sw def selectSort(A, N):
 sw = 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[i], A[minj] = A[minj], A[i]
   sw += 1
 return str(sw) def selectSort(A, N):
 sw = 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[i], A[minj] = A[minj], A[i]
   sw += 1
 return str(sw) selectSort A = list(map(int,input().split())) list(map(int,input().split())) A N = int(input()) int(input()) N
N = int(input())
A = list(map(int,input().split()))

def selectSort(A, N):
 sw = 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[i], A[minj] = A[minj], A[i]
   sw += 1
 return str(sw)

sw = selectSort(A, N)
print(" ".join(map(str, A)))
print(sw)