N = int(input())
A = [int(x) for x in input().split()]
times = 0

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


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

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


print(*A)
print(times)