#coding:utf-8
n = int(input())
A = list(map(int, input().split()))

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

B = " ".join([str(num) for num in A])
print(B)
print(times)
 n = int(input()) n int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split times = 0 times 0 for i in range(n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        A[i], A[minj] = A[minj], A[i]
        times += 1 i range(n) range 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 i != minj:
        A[i], A[minj] = A[minj], A[i]
        times += 1 i != minj i minj A[i], A[minj] = A[minj], A[i] A[i] A i A[minj] A minj A[minj] A minj A[i] A i times += 1 times 1 str(num) for num in A for num in A num A for num in A str(num) str num B = " ".join([str(num) for num in A]) B " ".join([str(num) for num in A]) " ".join " " join [str(num) for num in A] print(B) print B print(times) print times times += 1 1 times A = list(map(int, input().split())) list(map(int, input().split())) A minj = i i minj n = int(input()) int(input()) n minj = j j minj times = 0 0 times B = " ".join([str(num) for num in A]) " ".join([str(num) for num in A]) B
#coding:utf-8
n = int(input())
A = list(map(int, input().split()))

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

B = " ".join([str(num) for num in A])
print(B)
print(times)

