N = int(raw_input())
lst = map(int, raw_input().split())
cnt = 0
for i in range(0, len(lst)):
    m = i
    for j in range(i, len(lst)):
        if lst[m] > lst[j]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt+=1

print " ".join(map(str,lst))
print (cnt) N = int(raw_input()) N int(raw_input()) int raw_input() raw_input lst = map(int, raw_input().split()) lst map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split cnt = 0 cnt 0 for i in range(0, len(lst)):
    m = i
    for j in range(i, len(lst)):
        if lst[m] > lst[j]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt+=1 i range(0, len(lst)) range 0 len(lst) len lst m = i m i for j in range(i, len(lst)):
        if lst[m] > lst[j]:
            m = j
     j range(i, len(lst)) range i len(lst) len lst if lst[m] > lst[j]:
            m = j
     lst[m] > lst[j] lst[m] lst m lst[j] lst j m = j m j if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt+=1 m != i m i lst[i], lst[m] = lst[m], lst[i] lst[i] lst i lst[m] lst m lst[m] lst m lst[i] lst i cnt+=1 cnt 1 print " ".join(map(str,lst)) " ".join " " join map(str,lst) map str lst print (cnt) print cnt cnt = 0 0 cnt m = i i m cnt+=1 1 cnt N = int(raw_input()) int(raw_input()) N lst = map(int, raw_input().split()) map(int, raw_input().split()) lst m = j j m
N = int(raw_input())
lst = map(int, raw_input().split())
cnt = 0
for i in range(0, len(lst)):
    m = i
    for j in range(i, len(lst)):
        if lst[m] > lst[j]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt+=1

print " ".join(map(str,lst))
print (cnt)