N = int(raw_input())
num_list = map(int, raw_input().split())
c = 0

for i in range(0,N,1):
    flag =0
    minj =i
    for j in range(i,N,1):
        if num_list[j] < num_list[minj]:
            minj = j
            flag = 1
    c += flag
    num_list[i], num_list[minj] = num_list[minj], num_list[i]
print " ".join(map(str,num_list))
print c N = int(raw_input()) N int(raw_input()) int raw_input() raw_input num_list = map(int, raw_input().split()) num_list map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split c = 0 c 0 for i in range(0,N,1):
    flag =0
    minj =i
    for j in range(i,N,1):
        if num_list[j] < num_list[minj]:
            minj = j
            flag = 1
    c += flag
    num_list[i], num_list[minj] = num_list[minj], num_list[i] i range(0,N,1) range 0 N 1 flag =0 flag 0 minj =i minj i for j in range(i,N,1):
        if num_list[j] < num_list[minj]:
            minj = j
            flag = 1
     j range(i,N,1) range i N 1 if num_list[j] < num_list[minj]:
            minj = j
            flag = 1
     num_list[j] < num_list[minj] num_list[j] num_list j num_list[minj] num_list minj minj = j minj j flag = 1 flag 1 c += flag c flag num_list[i], num_list[minj] = num_list[minj], num_list[i] num_list[i] num_list i num_list[minj] num_list minj num_list[minj] num_list minj num_list[i] num_list i print " ".join(map(str,num_list)) " ".join " " join map(str,num_list) map str num_list print flag =0 0 flag minj = j j minj N = int(raw_input()) int(raw_input()) N c = 0 0 c minj =i i minj flag = 1 1 flag num_list = map(int, raw_input().split()) map(int, raw_input().split()) num_list c += flag flag c
N = int(raw_input())
num_list = map(int, raw_input().split())
c = 0

for i in range(0,N,1):
    flag =0
    minj =i
    for j in range(i,N,1):
        if num_list[j] < num_list[minj]:
            minj = j
            flag = 1
    c += flag
    num_list[i], num_list[minj] = num_list[minj], num_list[i]
print " ".join(map(str,num_list))
print c