N = int(raw_input())
A = map(int, raw_input().split())

counter = 0
for i in xrange(N):
  minj = i
  for j in xrange(i, N):
    if A[j] < A[minj]:
      minj = j
  if i != minj:
    tmp = A[i]
    A[i] = A[minj]
    A[minj] = tmp
    counter += 1
print " ".join(map(str, A))
print counter 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 counter = 0 counter 0 for i in xrange(N):
  minj = i
  for j in xrange(i, N):
    if A[j] < A[minj]:
      minj = j
  if i != minj:
    tmp = A[i]
    A[i] = A[minj]
    A[minj] = tmp
    counter += 1 i xrange(N) xrange N minj = i minj i for j in xrange(i, N):
    if A[j] < A[minj]:
      minj = j
   j xrange(i, N) xrange 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 i != minj:
    tmp = A[i]
    A[i] = A[minj]
    A[minj] = tmp
    counter += 1 i != minj i 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 counter += 1 counter 1 print " ".join(map(str, A)) " ".join " " join map(str, A) map str A print minj = j j minj N = int(raw_input()) int(raw_input()) N minj = i i minj tmp = A[i] A[i] tmp counter = 0 0 counter A = map(int, raw_input().split()) map(int, raw_input().split()) A counter += 1 1 counter
N = int(raw_input())
A = map(int, raw_input().split())

counter = 0
for i in xrange(N):
  minj = i
  for j in xrange(i, N):
    if A[j] < A[minj]:
      minj = j
  if i != minj:
    tmp = A[i]
    A[i] = A[minj]
    A[minj] = tmp
    counter += 1
print " ".join(map(str, A))
print counter