N = int(input())
line = list(map(int, input().split()))

cnt = 0
for i in range(N):
    minj = i
    for j in range(i+1, N):
        if line[j] < line[minj]:
            minj = j
    if minj != i:
        tmp = line[i]
        line[i] = line[minj]
        line[minj] = tmp
        cnt += 1

print(' '.join(list(map(str, line))))
print(cnt) N = int(input()) N int(input()) int input() input line = list(map(int, input().split())) line list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for i in range(N):
    minj = i
    for j in range(i+1, N):
        if line[j] < line[minj]:
            minj = j
    if minj != i:
        tmp = line[i]
        line[i] = line[minj]
        line[minj] = tmp
        cnt += 1 i range(N) range N minj = i minj i for j in range(i+1, N):
        if line[j] < line[minj]:
            minj = j
     j range(i+1, N) range i+1 i 1 N if line[j] < line[minj]:
            minj = j
     line[j] < line[minj] line[j] line j line[minj] line minj minj = j minj j if minj != i:
        tmp = line[i]
        line[i] = line[minj]
        line[minj] = tmp
        cnt += 1 minj != i minj i tmp = line[i] tmp line[i] line i line[i] = line[minj] line[i] line i line[minj] line minj line[minj] = tmp line[minj] line minj tmp cnt += 1 cnt 1 print(' '.join(list(map(str, line)))) print ' '.join(list(map(str, line))) ' '.join ' ' join list(map(str, line)) list map(str, line) map str line print(cnt) print cnt minj = i i minj tmp = line[i] line[i] tmp minj = j j minj line = list(map(int, input().split())) list(map(int, input().split())) line N = int(input()) int(input()) N cnt = 0 0 cnt cnt += 1 1 cnt
N = int(input())
line = list(map(int, input().split()))

cnt = 0
for i in range(N):
    minj = i
    for j in range(i+1, N):
        if line[j] < line[minj]:
            minj = j
    if minj != i:
        tmp = line[i]
        line[i] = line[minj]
        line[minj] = tmp
        cnt += 1

print(' '.join(list(map(str, line))))
print(cnt)