n = int(input())
s = input().split(" ")
nums = list(map(int,s))
koukan = 0
for i in range(n):
    minj = i
    for j in range(i+1,n):
        if nums[j] < nums[minj]:
            minj = j
    w = nums[i]
    nums[i] = nums[minj]
    nums[minj] = w
    if i != minj:
        koukan += 1
for i in range(n):
    if i == n-1:
        print(nums[i])
    else:
        print(nums[i],end=" ")
print(koukan) n = int(input()) n int(input()) int input() input s = input().split(" ") s input().split(" ") ().split () input split " " nums = list(map(int,s)) nums list(map(int,s)) list map(int,s) map int s koukan = 0 koukan 0 for i in range(n):
    minj = i
    for j in range(i+1,n):
        if nums[j] < nums[minj]:
            minj = j
    w = nums[i]
    nums[i] = nums[minj]
    nums[minj] = w
    if i != minj:
        koukan += 1 i range(n) range n minj = i minj i for j in range(i+1,n):
        if nums[j] < nums[minj]:
            minj = j
     j range(i+1,n) range i+1 i 1 n if nums[j] < nums[minj]:
            minj = j
     nums[j] < nums[minj] nums[j] nums j nums[minj] nums minj minj = j minj j w = nums[i] w nums[i] nums i nums[i] = nums[minj] nums[i] nums i nums[minj] nums minj nums[minj] = w nums[minj] nums minj w if i != minj:
        koukan += 1 i != minj i minj koukan += 1 koukan 1 for i in range(n):
    if i == n-1:
        print(nums[i])
    else:
        print(nums[i],end=" ") i range(n) range n if i == n-1:
        print(nums[i])
    else:
        print(nums[i],end=" ") i == n-1 i n-1 n 1 print(nums[i]) print nums[i] nums i print(nums[i],end=" ") print nums[i] nums i end=" " end " " print(koukan) print koukan s = input().split(" ") input().split(" ") s koukan = 0 0 koukan minj = j j minj koukan += 1 1 koukan minj = i i minj n = int(input()) int(input()) n nums = list(map(int,s)) list(map(int,s)) nums w = nums[i] nums[i] w
n = int(input())
s = input().split(" ")
nums = list(map(int,s))
koukan = 0
for i in range(n):
    minj = i
    for j in range(i+1,n):
        if nums[j] < nums[minj]:
            minj = j
    w = nums[i]
    nums[i] = nums[minj]
    nums[minj] = w
    if i != minj:
        koukan += 1
for i in range(n):
    if i == n-1:
        print(nums[i])
    else:
        print(nums[i],end=" ")
print(koukan)