length = int(input())
eles = [int(l) for l in input().split()]
times = 0

for i in range(length-1):
    _min = i
    for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
    if i != _min:
        eles[i], eles[_min] = eles[_min], eles[i]
        times += 1

print(*eles)
print(times) length = int(input()) length int(input()) int input() input int(l) for l in input().split() for l in input().split() l input().split() ().split () input split for l in input().split() int(l) int l eles = [int(l) for l in input().split()] eles [int(l) for l in input().split()] times = 0 times 0 for i in range(length-1):
    _min = i
    for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
    if i != _min:
        eles[i], eles[_min] = eles[_min], eles[i]
        times += 1 i range(length-1) range length-1 length 1 _min = i _min i for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
     j range(i, length) range i length if eles[j] < eles[_min]:
            _min = j
     eles[j] < eles[_min] eles[j] eles j eles[_min] eles _min _min = j _min j if i != _min:
        eles[i], eles[_min] = eles[_min], eles[i]
        times += 1 i != _min i _min eles[i], eles[_min] = eles[_min], eles[i] eles[i] eles i eles[_min] eles _min eles[_min] eles _min eles[i] eles i times += 1 times 1 print(*eles) print *eles eles print(times) print times _min = j j _min _min = i i _min times += 1 1 times length = int(input()) int(input()) length times = 0 0 times eles = [int(l) for l in input().split()] [int(l) for l in input().split()] eles
length = int(input())
eles = [int(l) for l in input().split()]
times = 0

for i in range(length-1):
    _min = i
    for j in range(i, length):
        if eles[j] < eles[_min]:
            _min = j
    if i != _min:
        eles[i], eles[_min] = eles[_min], eles[i]
        times += 1

print(*eles)
print(times)