data_num = int(input())
nums = list(map(int, input().split(" ")))
cnt = 0
for i in range(data_num):
    min_idx = i
    for j in range(i, data_num):
        if nums[j] < nums[min_idx]:
            min_idx = j

    if i != min_idx:
        nums[i], nums[min_idx] = nums[min_idx], nums[i]
        cnt += 1

print(" ".join(map(str,nums)) + "\n" + str(cnt)) data_num = int(input()) data_num int(input()) int input() input nums = list(map(int, input().split(" "))) nums list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " cnt = 0 cnt 0 for i in range(data_num):
    min_idx = i
    for j in range(i, data_num):
        if nums[j] < nums[min_idx]:
            min_idx = j

    if i != min_idx:
        nums[i], nums[min_idx] = nums[min_idx], nums[i]
        cnt += 1 i range(data_num) range data_num min_idx = i min_idx i for j in range(i, data_num):
        if nums[j] < nums[min_idx]:
            min_idx = j

     j range(i, data_num) range i data_num if nums[j] < nums[min_idx]:
            min_idx = j

     nums[j] < nums[min_idx] nums[j] nums j nums[min_idx] nums min_idx min_idx = j min_idx j if i != min_idx:
        nums[i], nums[min_idx] = nums[min_idx], nums[i]
        cnt += 1 i != min_idx i min_idx nums[i], nums[min_idx] = nums[min_idx], nums[i] nums[i] nums i nums[min_idx] nums min_idx nums[min_idx] nums min_idx nums[i] nums i cnt += 1 cnt 1 print(" ".join(map(str,nums)) + "\n" + str(cnt)) print " ".join(map(str,nums)) + "\n" + str(cnt) " ".join(map(str,nums)) + "\n" " ".join(map(str,nums)) " ".join " " join map(str,nums) map str nums "\n" str(cnt) str cnt data_num = int(input()) int(input()) data_num min_idx = i i min_idx min_idx = j j min_idx nums = list(map(int, input().split(" "))) list(map(int, input().split(" "))) nums cnt += 1 1 cnt cnt = 0 0 cnt
data_num = int(input())
nums = list(map(int, input().split(" ")))
cnt = 0
for i in range(data_num):
    min_idx = i
    for j in range(i, data_num):
        if nums[j] < nums[min_idx]:
            min_idx = j

    if i != min_idx:
        nums[i], nums[min_idx] = nums[min_idx], nums[i]
        cnt += 1

print(" ".join(map(str,nums)) + "\n" + str(cnt))