N = int(input())
A = [int(x) for x in input().split()]
cnt = 0

for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            # ????°???????index?????´??°
            minj = j

    if A[minj] != A[i]:
        cnt += 1
    # i???????????¨???
    buf = A[minj]
    A[minj] = A[i]
    A[i] = buf


print(' '.join(str(x) for x in A))
print(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 A = [int(x) for x in input().split()] A [int(x) for x in input().split()] cnt = 0 cnt 0 for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            # ????°???????index?????´??°
            minj = j

    if A[minj] != A[i]:
        cnt += 1
    # i???????????¨???
    buf = A[minj]
    A[minj] = A[i]
    A[i] = buf i range(N) range N minj = i minj i for j in range(i, N):
        if A[j] < A[minj]:
            # ????°???????index?????´??°
            minj = j

     j range(i, N) range i N if A[j] < A[minj]:
            # ????°???????index?????´??°
            minj = j

     A[j] < A[minj] A[j] A j A[minj] A minj minj = j minj j if A[minj] != A[i]:
        cnt += 1
    # i???????????¨???
     A[minj] != A[i] A[minj] A minj A[i] A i cnt += 1 cnt 1 buf = A[minj] buf A[minj] A minj A[minj] = A[i] A[minj] A minj A[i] A i A[i] = buf A[i] A i buf print(' '.join(str(x) for x in A)) print ' '.join(str(x) for x in A) ' '.join ' ' join str(x) str x print(cnt) print cnt A = [int(x) for x in input().split()] [int(x) for x in input().split()] A cnt = 0 0 cnt minj = j j minj N = int(input()) int(input()) N minj = i i minj cnt += 1 1 cnt buf = A[minj] A[minj] buf
N = int(input())
A = [int(x) for x in input().split()]
cnt = 0

for i in range(N):
    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            # ????°???????index?????´??°
            minj = j

    if A[minj] != A[i]:
        cnt += 1
    # i???????????¨???
    buf = A[minj]
    A[minj] = A[i]
    A[i] = buf


print(' '.join(str(x) for x in A))
print(cnt)