n = int(input())
data = [int(s) for s in input().split()]

change = 0
new = []
for idx in range(n):
	idx_min = data[idx:].index(min(data[idx:])) + idx
	if idx_min > idx:
		data[idx],data[idx_min] = data[idx_min],data[idx]
		change += 1

print(' '.join([str(d) for d in data]))
print(change) n = int(input()) n int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s data = [int(s) for s in input().split()] data [int(s) for s in input().split()] change = 0 change 0 new = [] new [] for idx in range(n):
	idx_min = data[idx:].index(min(data[idx:])) + idx
	if idx_min > idx:
		data[idx],data[idx_min] = data[idx_min],data[idx]
		change += 1 idx range(n) range n idx_min = data[idx:].index(min(data[idx:])) + idx idx_min data[idx:].index(min(data[idx:])) + idx data[idx:].index(min(data[idx:])) [idx:].index [idx:] data idx: idx index min(data[idx:]) min data[idx:] data idx: idx idx if idx_min > idx:
		data[idx],data[idx_min] = data[idx_min],data[idx]
		change += 1 idx_min > idx idx_min idx data[idx],data[idx_min] = data[idx_min],data[idx] data[idx] data idx data[idx_min] data idx_min data[idx_min] data idx_min data[idx] data idx change += 1 change 1 str(d) for d in data for d in data d data for d in data str(d) str d print(' '.join([str(d) for d in data])) print ' '.join([str(d) for d in data]) ' '.join ' ' join [str(d) for d in data] print(change) print change idx_min = data[idx:].index(min(data[idx:])) + idx data[idx:].index(min(data[idx:])) + idx idx_min change = 0 0 change data = [int(s) for s in input().split()] [int(s) for s in input().split()] data new = [] [] new n = int(input()) int(input()) n change += 1 1 change
n = int(input())
data = [int(s) for s in input().split()]

change = 0
new = []
for idx in range(n):
	idx_min = data[idx:].index(min(data[idx:])) + idx
	if idx_min > idx:
		data[idx],data[idx_min] = data[idx_min],data[idx]
		change += 1

print(' '.join([str(d) for d in data]))
print(change)