N = int(input())
A = list(map(int, input().split()))
c = 0
for i in range(N-1):
    minj = i
    boo = 0
    for j in range(i,N):
        if A[j] < A[minj]:
            minj = j
            boo = 1
    A[i], A[minj] = A[minj], A[i]
    if boo:
        c += 1
print(*A)
print(c)
 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 c = 0 c 0 for i in range(N-1):
    minj = i
    boo = 0
    for j in range(i,N):
        if A[j] < A[minj]:
            minj = j
            boo = 1
    A[i], A[minj] = A[minj], A[i]
    if boo:
        c += 1 i range(N-1) range N-1 N 1 minj = i minj i boo = 0 boo 0 for j in range(i,N):
        if A[j] < A[minj]:
            minj = j
            boo = 1
     j range(i,N) range i N if A[j] < A[minj]:
            minj = j
            boo = 1
     A[j] < A[minj] A[j] A j A[minj] A minj minj = j minj j boo = 1 boo 1 A[i], A[minj] = A[minj], A[i] A[i] A i A[minj] A minj A[minj] A minj A[i] A i if boo:
        c += 1 boo c += 1 c 1 print(*A) print *A A print(c) print c c += 1 1 c N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A boo = 1 1 boo boo = 0 0 boo minj = i i minj c = 0 0 c minj = j j minj
N = int(input())
A = list(map(int, input().split()))
c = 0
for i in range(N-1):
    minj = i
    boo = 0
    for j in range(i,N):
        if A[j] < A[minj]:
            minj = j
            boo = 1
    A[i], A[minj] = A[minj], A[i]
    if boo:
        c += 1
print(*A)
print(c)

