n = int(eval(input()))

a = list(map(int, input().split()))



count = 0



for i in range( n ):

    mini = i

    for j in range( i, n ):

        if a[j] < a[mini]:

            mini = j

    if mini != i:

        count += 1

        t = a[i]

        a[i] = a[mini]

        a[mini] = t



print(( *a ))

print( count )
N = int(eval(input()))

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



if __name__ == "__main__":

    cnt = 0

    for i in range(N):

        tmp_idx = i

        for j in range(i+1, N):

            if A[tmp_idx] > A[j]:

                tmp_idx = j

        if tmp_idx != i:

            A[i], A[tmp_idx] = A[tmp_idx], A[i]

            cnt += 1



    print((" ".join(map(str, A))))

    print(cnt)

n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
for i in range(n):
    mini = i
    for j in range(i, n):
        if a[j] < a[mini]:
            mini = j
    if mini != i:
        count += 1
        t = a[i]
        a[i] = a[mini]
        a[mini] = t
print((*a))
print(count)

N = int(eval(input()))
A = list(map(int, input().split()))
if __name__ == "__main__":
    cnt = 0
    for i in range(N):
        tmp_idx = i
        for j in range(i + 1, N):
            if A[tmp_idx] > A[j]:
                tmp_idx = j
        if tmp_idx != i:
            A[i], A[tmp_idx] = A[tmp_idx], A[i]
            cnt += 1
    print((" ".join(map(str, A))))
    print(cnt)

-n = int(eval(input())) -a = list(map(int, input().split())) -count = 0 -for i in range(n): -    mini = i -    for j in range(i, n): -        if a[j] < a[mini]: -            mini = j -    if mini != i: -        count += 1 -        t = a[i] -        a[i] = a[mini] -        a[mini] = t -print((*a)) -print(count) +N = int(eval(input())) +A = list(map(int, input().split())) +if __name__ == "__main__": +    cnt = 0 +    for i in range(N): +        tmp_idx = i +        for j in range(i + 1, N): +            if A[tmp_idx] > A[j]: +                tmp_idx = j +        if tmp_idx != i: +            A[i], A[tmp_idx] = A[tmp_idx], A[i] +            cnt += 1 +    print((" ".join(map(str, A)))) +    print(cnt)