n = int(input())
li = list(map(int, input().split()))
cnt = 0

for i in range(n):
	minj = i
	for j in range(i, n):
		if li[j] < li[minj]:
			minj = j
	if li[i] != li[minj]:
		li[i], li[minj] = li[minj], li[i]
		cnt += 1

print(*li)
print(cnt) n = int(input()) n int(input()) int input() input li = list(map(int, input().split())) li 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(n):
	minj = i
	for j in range(i, n):
		if li[j] < li[minj]:
			minj = j
	if li[i] != li[minj]:
		li[i], li[minj] = li[minj], li[i]
		cnt += 1 i range(n) range n minj = i minj i for j in range(i, n):
		if li[j] < li[minj]:
			minj = j
	 j range(i, n) range i n if li[j] < li[minj]:
			minj = j
	 li[j] < li[minj] li[j] li j li[minj] li minj minj = j minj j if li[i] != li[minj]:
		li[i], li[minj] = li[minj], li[i]
		cnt += 1 li[i] != li[minj] li[i] li i li[minj] li minj li[i], li[minj] = li[minj], li[i] li[i] li i li[minj] li minj li[minj] li minj li[i] li i cnt += 1 cnt 1 print(*li) print *li li print(cnt) print cnt minj = j j minj li = list(map(int, input().split())) list(map(int, input().split())) li cnt += 1 1 cnt cnt = 0 0 cnt n = int(input()) int(input()) n minj = i i minj
n = int(input())
li = list(map(int, input().split()))
cnt = 0

for i in range(n):
	minj = i
	for j in range(i, n):
		if li[j] < li[minj]:
			minj = j
	if li[i] != li[minj]:
		li[i], li[minj] = li[minj], li[i]
		cnt += 1

print(*li)
print(cnt)