N = int(input())
ary = [int(_) for _ in input().split()]


def selection_sort(ary, verbose=True):
    count = 0

    for i in range(0, N):
        minj = i

        for j in range(i, N):
            if ary[j] < ary[minj]:
                minj = j

        if i != minj:
            ary[i], ary[minj] = ary[minj], ary[i]
            count += 1

    print(' '.join([str(_) for _ in ary]))

    if verbose:
        print(count)


selection_sort(ary)
 N = int(input()) N int(input()) int input() input int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ ary = [int(_) for _ in input().split()] ary [int(_) for _ in input().split()] def selection_sort(ary, verbose=True):
    count = 0

    for i in range(0, N):
        minj = i

        for j in range(i, N):
            if ary[j] < ary[minj]:
                minj = j

        if i != minj:
            ary[i], ary[minj] = ary[minj], ary[i]
            count += 1

    print(' '.join([str(_) for _ in ary]))

    if verbose:
        print(count) selection_sort count = 0 count 0 for i in range(0, N):
        minj = i

        for j in range(i, N):
            if ary[j] < ary[minj]:
                minj = j

        if i != minj:
            ary[i], ary[minj] = ary[minj], ary[i]
            count += 1

     i range(0, N) range 0 N minj = i minj i for j in range(i, N):
            if ary[j] < ary[minj]:
                minj = j

         j range(i, N) range i N if ary[j] < ary[minj]:
                minj = j

         ary[j] < ary[minj] ary[j] ary j ary[minj] ary minj minj = j minj j if i != minj:
            ary[i], ary[minj] = ary[minj], ary[i]
            count += 1

     i != minj i minj ary[i], ary[minj] = ary[minj], ary[i] ary[i] ary i ary[minj] ary minj ary[minj] ary minj ary[i] ary i count += 1 count 1 str(_) for _ in ary for _ in ary _ ary for _ in ary str(_) str _ print(' '.join([str(_) for _ in ary])) print ' '.join([str(_) for _ in ary]) ' '.join ' ' join [str(_) for _ in ary] if verbose:
        print(count) verbose print(count) print count ary ary verbose=True verbose True selection_sort(ary) selection_sort ary N = int(input()) int(input()) N ary = [int(_) for _ in input().split()] [int(_) for _ in input().split()] ary def selection_sort(ary, verbose=True):
    count = 0

    for i in range(0, N):
        minj = i

        for j in range(i, N):
            if ary[j] < ary[minj]:
                minj = j

        if i != minj:
            ary[i], ary[minj] = ary[minj], ary[i]
            count += 1

    print(' '.join([str(_) for _ in ary]))

    if verbose:
        print(count) def selection_sort(ary, verbose=True):
    count = 0

    for i in range(0, N):
        minj = i

        for j in range(i, N):
            if ary[j] < ary[minj]:
                minj = j

        if i != minj:
            ary[i], ary[minj] = ary[minj], ary[i]
            count += 1

    print(' '.join([str(_) for _ in ary]))

    if verbose:
        print(count) selection_sort
N = int(input())
ary = [int(_) for _ in input().split()]


def selection_sort(ary, verbose=True):
    count = 0

    for i in range(0, N):
        minj = i

        for j in range(i, N):
            if ary[j] < ary[minj]:
                minj = j

        if i != minj:
            ary[i], ary[minj] = ary[minj], ary[i]
            count += 1

    print(' '.join([str(_) for _ in ary]))

    if verbose:
        print(count)


selection_sort(ary)

