N, A, cou   = int(input()), [int(temp) for temp in input().split()], 0

for i in range(N) :
    minj = i
    for j in range(i, N) :
        if A[j] < A[minj] :
            minj = int(j)
    if A[i] != A[minj] :
        A[i], A[minj] = int(A[minj]), int(A[i])
        cou = cou + 1
print(*A)
print(cou) int(temp) for temp in input().split() for temp in input().split() temp input().split() ().split () input split for temp in input().split() int(temp) int temp N, A, cou   = int(input()), [int(temp) for temp in input().split()], 0 N int(input()) int input() input A [int(temp) for temp in input().split()] cou 0 for i in range(N) :
    minj = i
    for j in range(i, N) :
        if A[j] < A[minj] :
            minj = int(j)
    if A[i] != A[minj] :
        A[i], A[minj] = int(A[minj]), int(A[i])
        cou = cou + 1 i range(N) range N minj = i minj i for j in range(i, N) :
        if A[j] < A[minj] :
            minj = int(j)
     j range(i, N) range i N if A[j] < A[minj] :
            minj = int(j)
     A[j] < A[minj] A[j] A j A[minj] A minj minj = int(j) minj int(j) int j if A[i] != A[minj] :
        A[i], A[minj] = int(A[minj]), int(A[i])
        cou = cou + 1 A[i] != A[minj] A[i] A i A[minj] A minj A[i], A[minj] = int(A[minj]), int(A[i]) A[i] A i int(A[minj]) int A[minj] A minj A[minj] A minj int(A[i]) int A[i] A i cou = cou + 1 cou cou + 1 cou 1 print(*A) print *A A print(cou) print cou cou = cou + 1 cou + 1 cou minj = int(j) int(j) minj N, A, cou   = int(input()), [int(temp) for temp in input().split()], 0 int(input()) N minj = i i minj A, cou   = int(input()), [int(temp) for temp in input().split()], 0 [int(temp) for temp in input().split()] A cou   = int(input()), [int(temp) for temp in input().split()], 0 0 cou
N, A, cou   = int(input()), [int(temp) for temp in input().split()], 0

for i in range(N) :
    minj = i
    for j in range(i, N) :
        if A[j] < A[minj] :
            minj = int(j)
    if A[i] != A[minj] :
        A[i], A[minj] = int(A[minj]), int(A[i])
        cou = cou + 1
print(*A)
print(cou)