N = int(input())
A = [int(n) for n in input().split()]
cnt = 0
for i in range(N):
    min_x = A[i]
    exchange = "no"
    for j in range(i+1, N):
        if min_x > A[j]:
            min_x = A[j]
            index = j
            exchange = "ok"
    if exchange == "ok":
        A[index] = A[i]
        A[i] = min_x
        cnt += 1
for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print(A[i], end=" ")
print(cnt) N = int(input()) N int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n A = [int(n) for n in input().split()] A [int(n) for n in input().split()] cnt = 0 cnt 0 for i in range(N):
    min_x = A[i]
    exchange = "no"
    for j in range(i+1, N):
        if min_x > A[j]:
            min_x = A[j]
            index = j
            exchange = "ok"
    if exchange == "ok":
        A[index] = A[i]
        A[i] = min_x
        cnt += 1 i range(N) range N min_x = A[i] min_x A[i] A i exchange = "no" exchange "no" for j in range(i+1, N):
        if min_x > A[j]:
            min_x = A[j]
            index = j
            exchange = "ok"
     j range(i+1, N) range i+1 i 1 N if min_x > A[j]:
            min_x = A[j]
            index = j
            exchange = "ok"
     min_x > A[j] min_x A[j] A j min_x = A[j] min_x A[j] A j index = j index j exchange = "ok" exchange "ok" if exchange == "ok":
        A[index] = A[i]
        A[i] = min_x
        cnt += 1 exchange == "ok" exchange "ok" A[index] = A[i] A[index] A index A[i] A i A[i] = min_x A[i] A i min_x cnt += 1 cnt 1 for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print(A[i], end=" ") i range(N) range N if i == N - 1:
        print(A[i])
    else:
        print(A[i], end=" ") i == N - 1 i N - 1 N 1 print(A[i]) print A[i] A i print(A[i], end=" ") print A[i] A i end=" " end " " print(cnt) print cnt exchange = "ok" "ok" exchange cnt = 0 0 cnt cnt += 1 1 cnt index = j j index A = [int(n) for n in input().split()] [int(n) for n in input().split()] A min_x = A[i] A[i] min_x exchange = "no" "no" exchange min_x = A[j] A[j] min_x N = int(input()) int(input()) N
N = int(input())
A = [int(n) for n in input().split()]
cnt = 0
for i in range(N):
    min_x = A[i]
    exchange = "no"
    for j in range(i+1, N):
        if min_x > A[j]:
            min_x = A[j]
            index = j
            exchange = "ok"
    if exchange == "ok":
        A[index] = A[i]
        A[i] = min_x
        cnt += 1
for i in range(N):
    if i == N - 1:
        print(A[i])
    else:
        print(A[i], end=" ")
print(cnt)