n = int(input())
a = [int(x) for x in input().split()]
c = 0
for x in range(n):
    m = x
    for i in range(x, n):
        if a[i] < a[m]:
            m = i
    if x != m:
        a[x], a[m] = a[m], a[x]
        c += 1
print(*a)
print(c) 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()] c = 0 c 0 for x in range(n):
    m = x
    for i in range(x, n):
        if a[i] < a[m]:
            m = i
    if x != m:
        a[x], a[m] = a[m], a[x]
        c += 1 x range(n) range n m = x m x for i in range(x, n):
        if a[i] < a[m]:
            m = i
     i range(x, n) range x n if a[i] < a[m]:
            m = i
     a[i] < a[m] a[i] a i a[m] a m m = i m i if x != m:
        a[x], a[m] = a[m], a[x]
        c += 1 x != m x m a[x], a[m] = a[m], a[x] a[x] a x a[m] a m a[m] a m a[x] a x c += 1 c 1 print(*a) print *a a print(c) print c m = x x m m = i i m a = [int(x) for x in input().split()] [int(x) for x in input().split()] a n = int(input()) int(input()) n c = 0 0 c c += 1 1 c
n = int(input())
a = [int(x) for x in input().split()]
c = 0
for x in range(n):
    m = x
    for i in range(x, n):
        if a[i] < a[m]:
            m = i
    if x != m:
        a[x], a[m] = a[m], a[x]
        c += 1
print(*a)
print(c)