#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_2_B

x = int(input())
y = list(map(int,input().split()))
z = 0

for i in range(x):
	minj = i
	for j in range(i,x):
		if y[j] < y[minj]:
			minj = j
	if not i == minj:
		y[i], y[minj] = y[minj], y[i]
		z += 1

print(" ".join(list(map(str,y))))
print(z) x = int(input()) x int(input()) int input() input y = list(map(int,input().split())) y list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split z = 0 z 0 for i in range(x):
	minj = i
	for j in range(i,x):
		if y[j] < y[minj]:
			minj = j
	if not i == minj:
		y[i], y[minj] = y[minj], y[i]
		z += 1 i range(x) range x minj = i minj i for j in range(i,x):
		if y[j] < y[minj]:
			minj = j
	 j range(i,x) range i x if y[j] < y[minj]:
			minj = j
	 y[j] < y[minj] y[j] y j y[minj] y minj minj = j minj j if not i == minj:
		y[i], y[minj] = y[minj], y[i]
		z += 1 not i == minj i == minj i minj y[i], y[minj] = y[minj], y[i] y[i] y i y[minj] y minj y[minj] y minj y[i] y i z += 1 z 1 print(" ".join(list(map(str,y)))) print " ".join(list(map(str,y))) " ".join " " join list(map(str,y)) list map(str,y) map str y print(z) print z minj = j j minj x = int(input()) int(input()) x z = 0 0 z z += 1 1 z minj = i i minj y = list(map(int,input().split())) list(map(int,input().split())) y
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_2_B

x = int(input())
y = list(map(int,input().split()))
z = 0

for i in range(x):
	minj = i
	for j in range(i,x):
		if y[j] < y[minj]:
			minj = j
	if not i == minj:
		y[i], y[minj] = y[minj], y[i]
		z += 1

print(" ".join(list(map(str,y))))
print(z)