N = int(input())
A = list(map(int, input().split()))

counter=0
for i in range(N):
	Ar = A[i:] #i?????????????´???\????????????????????????
	num = Ar.index(min(Ar)) #i?????????????´???\???????????????????????§???????°???????index?????????
	if num != 0:
		A[i], A[(i+num)] = A[(i+num)], A[i]
		counter += 1
print(" ".join(map(str,A)))
print(counter) N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split counter=0 counter 0 for i in range(N):
	Ar = A[i:] #i?????????????´???\????????????????????????
	num = Ar.index(min(Ar)) #i?????????????´???\???????????????????????§???????°???????index?????????
	if num != 0:
		A[i], A[(i+num)] = A[(i+num)], A[i]
		counter += 1 i range(N) range N Ar = A[i:] Ar A[i:] A i: i num = Ar.index(min(Ar)) num Ar.index(min(Ar)) Ar.index Ar index min(Ar) min Ar if num != 0:
		A[i], A[(i+num)] = A[(i+num)], A[i]
		counter += 1 num != 0 num 0 A[i], A[(i+num)] = A[(i+num)], A[i] A[i] A i A[(i+num)] A i+num i num A[(i+num)] A i+num i num A[i] A i counter += 1 counter 1 print(" ".join(map(str,A))) print " ".join(map(str,A)) " ".join " " join map(str,A) map str A print(counter) print counter N = int(input()) int(input()) N Ar = A[i:] A[i:] Ar num = Ar.index(min(Ar)) Ar.index(min(Ar)) num counter += 1 1 counter A = list(map(int, input().split())) list(map(int, input().split())) A counter=0 0 counter
N = int(input())
A = list(map(int, input().split()))

counter=0
for i in range(N):
	Ar = A[i:] #i?????????????´???\????????????????????????
	num = Ar.index(min(Ar)) #i?????????????´???\???????????????????????§???????°???????index?????????
	if num != 0:
		A[i], A[(i+num)] = A[(i+num)], A[i]
		counter += 1
print(" ".join(map(str,A)))
print(counter)