_ = input()
a = list(map(int, input().split()))

count = 0
for i in range(len(a)):
    minj = i
    for j in range(i+1, len(a)):
        #print('taiget {} in list {}'.format(a[i], a[j:]))
        if a[j] < a[minj]:
            minj = j
    #print('change[{}] to [{}]'.format(a[i], a[minj]))
    if a[i] != a[minj]:
        a[i], a[minj] = a[minj], a[i]
        count += 1

print(' '.join(map(str, a)))
print(count)
 _ = input() _ 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 count = 0 count 0 for i in range(len(a)):
    minj = i
    for j in range(i+1, len(a)):
        #print('taiget {} in list {}'.format(a[i], a[j:]))
        if a[j] < a[minj]:
            minj = j
    #print('change[{}] to [{}]'.format(a[i], a[minj]))
    if a[i] != a[minj]:
        a[i], a[minj] = a[minj], a[i]
        count += 1 i range(len(a)) range len(a) len a minj = i minj i for j in range(i+1, len(a)):
        #print('taiget {} in list {}'.format(a[i], a[j:]))
        if a[j] < a[minj]:
            minj = j
    #print('change[{}] to [{}]'.format(a[i], a[minj]))
     j range(i+1, len(a)) range i+1 i 1 len(a) len a if a[j] < a[minj]:
            minj = j
    #print('change[{}] to [{}]'.format(a[i], a[minj]))
     a[j] < a[minj] a[j] a j a[minj] a minj minj = j minj j if a[i] != a[minj]:
        a[i], a[minj] = a[minj], a[i]
        count += 1 a[i] != a[minj] a[i] a i a[minj] a 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 count += 1 count 1 print(' '.join(map(str, a))) print ' '.join(map(str, a)) ' '.join ' ' join map(str, a) map str a print(count) print count a = list(map(int, input().split())) list(map(int, input().split())) a _ = input() input() _ minj = j j minj count = 0 0 count minj = i i minj count += 1 1 count
_ = input()
a = list(map(int, input().split()))

count = 0
for i in range(len(a)):
    minj = i
    for j in range(i+1, len(a)):
        #print('taiget {} in list {}'.format(a[i], a[j:]))
        if a[j] < a[minj]:
            minj = j
    #print('change[{}] to [{}]'.format(a[i], a[minj]))
    if a[i] != a[minj]:
        a[i], a[minj] = a[minj], a[i]
        count += 1

print(' '.join(map(str, a)))
print(count)

