# -*- coding:utf-8 -*-

n = int(input())
str = input()
str = str.split()
a = []
for i in range(n):
    a.append(int(str[i]))

count = 0
for i in range(n):
    min = i
    for j in range(i,n):
        if a[j] < a[min]:
            min = j

    tmp = a[min]
    a[min] = a[i]
    a[i] = tmp
    if a[min] != a[i]:
        count += 1
for i in range(n-1):
    print(a[i],end = ' ')
print(a[n-1])
print(count) n = int(input()) n int(input()) int input() input str = input() str input() input str = str.split() str str.split() str.split str split a = [] a [] for i in range(n):
    a.append(int(str[i])) i range(n) range n a.append(int(str[i])) a.append a append int(str[i]) int str[i] str i count = 0 count 0 for i in range(n):
    min = i
    for j in range(i,n):
        if a[j] < a[min]:
            min = j

    tmp = a[min]
    a[min] = a[i]
    a[i] = tmp
    if a[min] != a[i]:
        count += 1 i range(n) range n min = i min i for j in range(i,n):
        if a[j] < a[min]:
            min = j

     j range(i,n) range i n if a[j] < a[min]:
            min = j

     a[j] < a[min] a[j] a j a[min] a min min = j min j tmp = a[min] tmp a[min] a min a[min] = a[i] a[min] a min a[i] a i a[i] = tmp a[i] a i tmp if a[min] != a[i]:
        count += 1 a[min] != a[i] a[min] a min a[i] a i count += 1 count 1 for i in range(n-1):
    print(a[i],end = ' ') i range(n-1) range n-1 n 1 print(a[i],end = ' ') print a[i] a i end = ' ' end ' ' print(a[n-1]) print a[n-1] a n-1 n 1 print(count) print count min = j j min count = 0 0 count count += 1 1 count n = int(input()) int(input()) n str = input() input() str str = str.split() str.split() str min = i i min a = [] [] a tmp = a[min] a[min] tmp
# -*- coding:utf-8 -*-

n = int(input())
str = input()
str = str.split()
a = []
for i in range(n):
    a.append(int(str[i]))

count = 0
for i in range(n):
    min = i
    for j in range(i,n):
        if a[j] < a[min]:
            min = j

    tmp = a[min]
    a[min] = a[i]
    a[i] = tmp
    if a[min] != a[i]:
        count += 1
for i in range(n-1):
    print(a[i],end = ' ')
print(a[n-1])
print(count)