times = int(input())
numbers = list(map(int, input().split()))
count = 0
minj = 0

for i in range(times):
    minj = i
    for j in range(i, times, 1):
        if numbers[j] < numbers[minj]:
            minj = j

    if i != minj:
        numbers[i], numbers[minj] = numbers[minj], numbers[i]
        count += 1

print(' '.join(map(str, numbers)))
print(count)
 times = int(input()) times int(input()) int input() input numbers = list(map(int, input().split())) numbers list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split count = 0 count 0 minj = 0 minj 0 for i in range(times):
    minj = i
    for j in range(i, times, 1):
        if numbers[j] < numbers[minj]:
            minj = j

    if i != minj:
        numbers[i], numbers[minj] = numbers[minj], numbers[i]
        count += 1 i range(times) range times minj = i minj i for j in range(i, times, 1):
        if numbers[j] < numbers[minj]:
            minj = j

     j range(i, times, 1) range i times 1 if numbers[j] < numbers[minj]:
            minj = j

     numbers[j] < numbers[minj] numbers[j] numbers j numbers[minj] numbers minj minj = j minj j if i != minj:
        numbers[i], numbers[minj] = numbers[minj], numbers[i]
        count += 1 i != minj i minj numbers[i], numbers[minj] = numbers[minj], numbers[i] numbers[i] numbers i numbers[minj] numbers minj numbers[minj] numbers minj numbers[i] numbers i count += 1 count 1 print(' '.join(map(str, numbers))) print ' '.join(map(str, numbers)) ' '.join ' ' join map(str, numbers) map str numbers print(count) print count count += 1 1 count times = int(input()) int(input()) times minj = 0 0 minj numbers = list(map(int, input().split())) list(map(int, input().split())) numbers minj = j j minj count = 0 0 count minj = i i minj
times = int(input())
numbers = list(map(int, input().split()))
count = 0
minj = 0

for i in range(times):
    minj = i
    for j in range(i, times, 1):
        if numbers[j] < numbers[minj]:
            minj = j

    if i != minj:
        numbers[i], numbers[minj] = numbers[minj], numbers[i]
        count += 1

print(' '.join(map(str, numbers)))
print(count)

