N = int(input())
A = [int(A) for A in input().split()]
cnt = 0
for i in range(N):
    A_min = i
    for j in range(i, N):
        if A[A_min] > A[j]:
            A_min = j
    if i != A_min:
        t = A[i]
        A[i] = A[A_min]
        A[A_min] = t
        cnt += 1

for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print("{}".format(A[i]), end=' ')

print(cnt) N = int(input()) N int(input()) int input() input int(A) for A in input().split() for A in input().split() A input().split() ().split () input split for A in input().split() int(A) int A A = [int(A) for A in input().split()] A [int(A) for A in input().split()] cnt = 0 cnt 0 for i in range(N):
    A_min = i
    for j in range(i, N):
        if A[A_min] > A[j]:
            A_min = j
    if i != A_min:
        t = A[i]
        A[i] = A[A_min]
        A[A_min] = t
        cnt += 1 i range(N) range N A_min = i A_min i for j in range(i, N):
        if A[A_min] > A[j]:
            A_min = j
     j range(i, N) range i N if A[A_min] > A[j]:
            A_min = j
     A[A_min] > A[j] A[A_min] A A_min A[j] A j A_min = j A_min j if i != A_min:
        t = A[i]
        A[i] = A[A_min]
        A[A_min] = t
        cnt += 1 i != A_min i A_min t = A[i] t A[i] A i A[i] = A[A_min] A[i] A i A[A_min] A A_min A[A_min] = t A[A_min] A A_min t cnt += 1 cnt 1 for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print("{}".format(A[i]), end=' ') i range(N) range N if i == N - 1:
        print(A[i])
    else:
        print("{}".format(A[i]), end=' ') i == N - 1 i N - 1 N 1 print(A[i]) print A[i] A i print("{}".format(A[i]), end=' ') print "{}".format(A[i]) "{}".format "{}" format A[i] A i end=' ' end ' ' print(cnt) print cnt A = [int(A) for A in input().split()] [int(A) for A in input().split()] A cnt += 1 1 cnt N = int(input()) int(input()) N cnt = 0 0 cnt A_min = i i A_min A_min = j j A_min t = A[i] A[i] t
N = int(input())
A = [int(A) for A in input().split()]
cnt = 0
for i in range(N):
    A_min = i
    for j in range(i, N):
        if A[A_min] > A[j]:
            A_min = j
    if i != A_min:
        t = A[i]
        A[i] = A[A_min]
        A[A_min] = t
        cnt += 1

for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print("{}".format(A[i]), end=' ')

print(cnt)