n = int(raw_input())
a = map(int, raw_input().split())

temp = 0
cnt = 0
for i in range(n):
	flag = 0
	min = i
	for j in range(i+1,n):
		if a[min] > a[j]:
			min = j
			flag = 1
	temp = a[i]
	a[i] = a[min]
	a[min] = temp
	cnt += flag

for i in range(n):
	if i != n-1:
		print(a[i]),
	else:
		print(a[i])

print cnt n = int(raw_input()) n int(raw_input()) int raw_input() raw_input a = map(int, raw_input().split()) a map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split temp = 0 temp 0 cnt = 0 cnt 0 for i in range(n):
	flag = 0
	min = i
	for j in range(i+1,n):
		if a[min] > a[j]:
			min = j
			flag = 1
	temp = a[i]
	a[i] = a[min]
	a[min] = temp
	cnt += flag i range(n) range n flag = 0 flag 0 min = i min i for j in range(i+1,n):
		if a[min] > a[j]:
			min = j
			flag = 1
	 j range(i+1,n) range i+1 i 1 n if a[min] > a[j]:
			min = j
			flag = 1
	 a[min] > a[j] a[min] a min a[j] a j min = j min j flag = 1 flag 1 temp = a[i] temp a[i] a i a[i] = a[min] a[i] a i a[min] a min a[min] = temp a[min] a min temp cnt += flag cnt flag for i in range(n):
	if i != n-1:
		print(a[i]),
	else:
		print(a[i]) i range(n) range n if i != n-1:
		print(a[i]),
	else:
		print(a[i]) i != n-1 i n-1 n 1 print(a[i]) print a[i] a i print(a[i]) print a[i] a i print min = i i min flag = 1 1 flag temp = 0 0 temp min = j j min flag = 0 0 flag n = int(raw_input()) int(raw_input()) n temp = a[i] a[i] temp cnt = 0 0 cnt a = map(int, raw_input().split()) map(int, raw_input().split()) a cnt += flag flag cnt
n = int(raw_input())
a = map(int, raw_input().split())

temp = 0
cnt = 0
for i in range(n):
	flag = 0
	min = i
	for j in range(i+1,n):
		if a[min] > a[j]:
			min = j
			flag = 1
	temp = a[i]
	a[i] = a[min]
	a[min] = temp
	cnt += flag

for i in range(n):
	if i != n-1:
		print(a[i]),
	else:
		print(a[i])

print cnt