n = int(input())
*A, = map(int, input().split())
ans = 0
for i in range(n):
    j = A[i:].index(min(A[i:])) + i
    A[i], A[j] = A[j], A[i]
    if i != j:
        ans += 1
print(*A)
print(ans) n = int(input()) n int(input()) int input() input *A, = map(int, input().split()) *A A map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in range(n):
    j = A[i:].index(min(A[i:])) + i
    A[i], A[j] = A[j], A[i]
    if i != j:
        ans += 1 i range(n) range n j = A[i:].index(min(A[i:])) + i j A[i:].index(min(A[i:])) + i A[i:].index(min(A[i:])) [i:].index [i:] A i: i index min(A[i:]) min A[i:] A i: i i A[i], A[j] = A[j], A[i] A[i] A i A[j] A j A[j] A j A[i] A i if i != j:
        ans += 1 i != j i j ans += 1 ans 1 print(*A) print *A A print(ans) print ans ans = 0 0 ans ans += 1 1 ans j = A[i:].index(min(A[i:])) + i A[i:].index(min(A[i:])) + i j n = int(input()) int(input()) n
n = int(input())
*A, = map(int, input().split())
ans = 0
for i in range(n):
    j = A[i:].index(min(A[i:])) + i
    A[i], A[j] = A[j], A[i]
    if i != j:
        ans += 1
print(*A)
print(ans)