n = int(input())
line = input()
arr= line.split(" ")
nums = []
for c in range(n):
    nums.append(int(arr[c]))

convert_n = 0
for i in range(len(nums)):
    minj = i
    for j in range(i, len(nums)):
        if nums[j] < nums[minj]:
            minj = j
    tmp = nums[i]
    nums[i] = nums[minj]
    nums[minj] = tmp
    if i != minj:
        convert_n += 1

n_list_str = ""
for num in nums:
    n_list_str += str(num)
    n_list_str += " "
print(n_list_str.rstrip(" "))
print(convert_n) n = int(input()) n int(input()) int input() input line = input() line input() input arr= line.split(" ") arr line.split(" ") line.split line split " " nums = [] nums [] for c in range(n):
    nums.append(int(arr[c])) c range(n) range n nums.append(int(arr[c])) nums.append nums append int(arr[c]) int arr[c] arr c convert_n = 0 convert_n 0 for i in range(len(nums)):
    minj = i
    for j in range(i, len(nums)):
        if nums[j] < nums[minj]:
            minj = j
    tmp = nums[i]
    nums[i] = nums[minj]
    nums[minj] = tmp
    if i != minj:
        convert_n += 1 i range(len(nums)) range len(nums) len nums minj = i minj i for j in range(i, len(nums)):
        if nums[j] < nums[minj]:
            minj = j
     j range(i, len(nums)) range i len(nums) len nums if nums[j] < nums[minj]:
            minj = j
     nums[j] < nums[minj] nums[j] nums j nums[minj] nums minj minj = j minj j tmp = nums[i] tmp nums[i] nums i nums[i] = nums[minj] nums[i] nums i nums[minj] nums minj nums[minj] = tmp nums[minj] nums minj tmp if i != minj:
        convert_n += 1 i != minj i minj convert_n += 1 convert_n 1 n_list_str = "" n_list_str "" for num in nums:
    n_list_str += str(num)
    n_list_str += " " num nums n_list_str += str(num) n_list_str str(num) str num n_list_str += " " n_list_str " " print(n_list_str.rstrip(" ")) print n_list_str.rstrip(" ") n_list_str.rstrip n_list_str rstrip " " print(convert_n) print convert_n minj = j j minj n_list_str += " " " " n_list_str line = input() input() line n_list_str = "" "" n_list_str n = int(input()) int(input()) n convert_n += 1 1 convert_n minj = i i minj n_list_str += str(num) str(num) n_list_str convert_n = 0 0 convert_n tmp = nums[i] nums[i] tmp arr= line.split(" ") line.split(" ") arr nums = [] [] nums
n = int(input())
line = input()
arr= line.split(" ")
nums = []
for c in range(n):
    nums.append(int(arr[c]))

convert_n = 0
for i in range(len(nums)):
    minj = i
    for j in range(i, len(nums)):
        if nums[j] < nums[minj]:
            minj = j
    tmp = nums[i]
    nums[i] = nums[minj]
    nums[minj] = tmp
    if i != minj:
        convert_n += 1

n_list_str = ""
for num in nums:
    n_list_str += str(num)
    n_list_str += " "
print(n_list_str.rstrip(" "))
print(convert_n)