n = int(input())
s = input()
A = list(map(int,s.split()))
flag = 1
cnt = 0
#####################################

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

#####################################
for k in range(0,len(A)-1):
    print(A[k],end=" ")
print(A[len(A)-1])
print (cnt) n = int(input()) n int(input()) int input() input s = input() s input() input A = list(map(int,s.split())) A list(map(int,s.split())) list map(int,s.split()) map int s.split() s.split s split flag = 1 flag 1 cnt = 0 cnt 0 for i in range(0,n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    if(A[i] != A[minj]):
        tmp = A[i]
        A[i] = A[minj]
        A[minj] = tmp
        cnt += 1

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

##################################### A[i] != A[minj] A[i] A i A[minj] A minj tmp = A[i] tmp A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = tmp A[minj] A minj tmp cnt += 1 cnt 1 for k in range(0,len(A)-1):
    print(A[k],end=" ") k range(0,len(A)-1) range 0 len(A)-1 len(A) len A 1 print(A[k],end=" ") print A[k] A k end=" " end " " print(A[len(A)-1]) print A[len(A)-1] A len(A)-1 len(A) len A 1 print (cnt) print cnt minj = j j minj n = int(input()) int(input()) n cnt += 1 1 cnt cnt = 0 0 cnt flag = 1 1 flag A = list(map(int,s.split())) list(map(int,s.split())) A tmp = A[i] A[i] tmp s = input() input() s minj = i i minj
n = int(input())
s = input()
A = list(map(int,s.split()))
flag = 1
cnt = 0
#####################################

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

#####################################
for k in range(0,len(A)-1):
    print(A[k],end=" ")
print(A[len(A)-1])
print (cnt)