N = int(input())
arr = [int(n) for n in input().split()]

swap_cnt = 0
for i in range(0, N):
    minj = i
    for j in range(i + 1, N):
        if arr[j] < arr[minj]:
            minj = j
    if (i != minj):
        arr[i], arr[minj] = arr[minj], arr[i]
        swap_cnt += 1

print(' '.join(map(str, arr)))
print(swap_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 arr = [int(n) for n in input().split()] arr [int(n) for n in input().split()] swap_cnt = 0 swap_cnt 0 for i in range(0, N):
    minj = i
    for j in range(i + 1, N):
        if arr[j] < arr[minj]:
            minj = j
    if (i != minj):
        arr[i], arr[minj] = arr[minj], arr[i]
        swap_cnt += 1 i range(0, N) range 0 N minj = i minj i for j in range(i + 1, N):
        if arr[j] < arr[minj]:
            minj = j
     j range(i + 1, N) range i + 1 i 1 N if arr[j] < arr[minj]:
            minj = j
     arr[j] < arr[minj] arr[j] arr j arr[minj] arr minj minj = j minj j if (i != minj):
        arr[i], arr[minj] = arr[minj], arr[i]
        swap_cnt += 1 i != minj i minj arr[i], arr[minj] = arr[minj], arr[i] arr[i] arr i arr[minj] arr minj arr[minj] arr minj arr[i] arr i swap_cnt += 1 swap_cnt 1 print(' '.join(map(str, arr))) print ' '.join(map(str, arr)) ' '.join ' ' join map(str, arr) map str arr print(swap_cnt) print swap_cnt swap_cnt += 1 1 swap_cnt minj = j j minj N = int(input()) int(input()) N arr = [int(n) for n in input().split()] [int(n) for n in input().split()] arr minj = i i minj swap_cnt = 0 0 swap_cnt
N = int(input())
arr = [int(n) for n in input().split()]

swap_cnt = 0
for i in range(0, N):
    minj = i
    for j in range(i + 1, N):
        if arr[j] < arr[minj]:
            minj = j
    if (i != minj):
        arr[i], arr[minj] = arr[minj], arr[i]
        swap_cnt += 1

print(' '.join(map(str, arr)))
print(swap_cnt)

