N = int(input())
l = input().split()
l = [int(s) for s in l]
count = 0
for j in range(N-1):
    min = l[j]
    for i in range(j,N):
        if( min > l[i]):
            min = l[i]
            a = i
    if(l[j]>min):
        l[j],l[a] = l[a],l[j]
        count += 1
for i in range(0,len(l)-1):
    print(l[i],end=' ')
print(l[N-1])
print(count) N = int(input()) N int(input()) int input() input l = input().split() l input().split() ().split () input split int(s) for s in l for s in l s l for s in l int(s) int s l = [int(s) for s in l] l [int(s) for s in l] count = 0 count 0 for j in range(N-1):
    min = l[j]
    for i in range(j,N):
        if( min > l[i]):
            min = l[i]
            a = i
    if(l[j]>min):
        l[j],l[a] = l[a],l[j]
        count += 1 j range(N-1) range N-1 N 1 min = l[j] min l[j] l j for i in range(j,N):
        if( min > l[i]):
            min = l[i]
            a = i
     i range(j,N) range j N if( min > l[i]):
            min = l[i]
            a = i
     min > l[i] min l[i] l i min = l[i] min l[i] l i a = i a i if(l[j]>min):
        l[j],l[a] = l[a],l[j]
        count += 1 l[j]>min l[j] l j min l[j],l[a] = l[a],l[j] l[j] l j l[a] l a l[a] l a l[j] l j count += 1 count 1 for i in range(0,len(l)-1):
    print(l[i],end=' ') i range(0,len(l)-1) range 0 len(l)-1 len(l) len l 1 print(l[i],end=' ') print l[i] l i end=' ' end ' ' print(l[N-1]) print l[N-1] l N-1 N 1 print(count) print count min = l[j] l[j] min l = input().split() input().split() l l = [int(s) for s in l] [int(s) for s in l] l a = i i a min = l[i] l[i] min count += 1 1 count N = int(input()) int(input()) N count = 0 0 count
N = int(input())
l = input().split()
l = [int(s) for s in l]
count = 0
for j in range(N-1):
    min = l[j]
    for i in range(j,N):
        if( min > l[i]):
            min = l[i]
            a = i
    if(l[j]>min):
        l[j],l[a] = l[a],l[j]
        count += 1
for i in range(0,len(l)-1):
    print(l[i],end=' ')
print(l[N-1])
print(count)
