
num_length = int(input())
num_array = [int(x) for x in input().split()]


def selectionsort(A, N):
    exchange_counter = 0
    for i in range(N):
        minj = i
        for j in range(i, N):
            if A[j] < A[minj]:
                minj = j

        if i != minj:
            A[i], A[minj] = A[minj], A[i]
            exchange_counter += 1

    print(" ".join(map(str, A)))
    print(exchange_counter)

selectionsort(num_array, num_length) num_length = int(input()) num_length 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 num_array = [int(x) for x in input().split()] num_array [int(x) for x in input().split()] def selectionsort(A, N):
    exchange_counter = 0
    for i in range(N):
        minj = i
        for j in range(i, N):
            if A[j] < A[minj]:
                minj = j

        if i != minj:
            A[i], A[minj] = A[minj], A[i]
            exchange_counter += 1

    print(" ".join(map(str, A)))
    print(exchange_counter) selectionsort exchange_counter = 0 exchange_counter 0 for i in range(N):
        minj = i
        for j in range(i, N):
            if A[j] < A[minj]:
                minj = j

        if i != minj:
            A[i], A[minj] = A[minj], A[i]
            exchange_counter += 1

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

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

         A[j] < A[minj] A[j] A j A[minj] A minj minj = j minj j if i != minj:
            A[i], A[minj] = A[minj], A[i]
            exchange_counter += 1

     i != minj i 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 exchange_counter += 1 exchange_counter 1 print(" ".join(map(str, A))) print " ".join(map(str, A)) " ".join " " join map(str, A) map str A print(exchange_counter) print exchange_counter A A N N selectionsort(num_array, num_length) selectionsort num_array num_length def selectionsort(A, N):
    exchange_counter = 0
    for i in range(N):
        minj = i
        for j in range(i, N):
            if A[j] < A[minj]:
                minj = j

        if i != minj:
            A[i], A[minj] = A[minj], A[i]
            exchange_counter += 1

    print(" ".join(map(str, A)))
    print(exchange_counter) def selectionsort(A, N):
    exchange_counter = 0
    for i in range(N):
        minj = i
        for j in range(i, N):
            if A[j] < A[minj]:
                minj = j

        if i != minj:
            A[i], A[minj] = A[minj], A[i]
            exchange_counter += 1

    print(" ".join(map(str, A)))
    print(exchange_counter) selectionsort num_array = [int(x) for x in input().split()] [int(x) for x in input().split()] num_array num_length = int(input()) int(input()) num_length

num_length = int(input())
num_array = [int(x) for x in input().split()]


def selectionsort(A, N):
    exchange_counter = 0
    for i in range(N):
        minj = i
        for j in range(i, N):
            if A[j] < A[minj]:
                minj = j

        if i != minj:
            A[i], A[minj] = A[minj], A[i]
            exchange_counter += 1

    print(" ".join(map(str, A)))
    print(exchange_counter)

selectionsort(num_array, num_length)