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

swap_cnt = 0

for i in range(n) :
    cmin = i
    for j in range(i + 1, n) :
        if s[j] < s[cmin] :
            cmin = j
            
    if i != cmin :
        s[i], s[cmin] = s[cmin], s[i]
        swap_cnt += 1
                
print(" ".join(map(str, s)))
print(swap_cnt)
 n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x s = [int(x) for x in input().split()] s [int(x) for x in input().split()] swap_cnt = 0 swap_cnt 0 for i in range(n) :
    cmin = i
    for j in range(i + 1, n) :
        if s[j] < s[cmin] :
            cmin = j
            
    if i != cmin :
        s[i], s[cmin] = s[cmin], s[i]
        swap_cnt += 1
                 i range(n) range n cmin = i cmin i for j in range(i + 1, n) :
        if s[j] < s[cmin] :
            cmin = j
            
     j range(i + 1, n) range i + 1 i 1 n if s[j] < s[cmin] :
            cmin = j
            
     s[j] < s[cmin] s[j] s j s[cmin] s cmin cmin = j cmin j if i != cmin :
        s[i], s[cmin] = s[cmin], s[i]
        swap_cnt += 1
                 i != cmin i cmin s[i], s[cmin] = s[cmin], s[i] s[i] s i s[cmin] s cmin s[cmin] s cmin s[i] s i swap_cnt += 1 swap_cnt 1 print(" ".join(map(str, s))) print " ".join(map(str, s)) " ".join " " join map(str, s) map str s print(swap_cnt) print swap_cnt n = int(input()) int(input()) n cmin = i i cmin cmin = j j cmin s = [int(x) for x in input().split()] [int(x) for x in input().split()] s swap_cnt = 0 0 swap_cnt swap_cnt += 1 1 swap_cnt
n = int(input())
s = [int(x) for x in input().split()]

swap_cnt = 0

for i in range(n) :
    cmin = i
    for j in range(i + 1, n) :
        if s[j] < s[cmin] :
            cmin = j
            
    if i != cmin :
        s[i], s[cmin] = s[cmin], s[i]
        swap_cnt += 1
                
print(" ".join(map(str, s)))
print(swap_cnt)

