
import java.util.Scanner;

public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a[] = new int[n];
        for(int i = 0;i < n;i++)a[i] = scan.nextInt();

        int t = 0; 
        for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        }

        for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        }
        System.out.println("\n" + t);

        scan.close();
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a[] = new int[n];
        for(int i = 0;i < n;i++)a[i] = scan.nextInt();

        int t = 0; 
        for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        }

        for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        }
        System.out.println("\n" + t);

        scan.close();
    }

} Main public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a[] = new int[n];
        for(int i = 0;i < n;i++)a[i] = scan.nextInt();

        int t = 0; 
        for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        }

        for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        }
        System.out.println("\n" + t);

        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a[] = new int[n];
        for(int i = 0;i < n;i++)a[i] = scan.nextInt();

        int t = 0; 
        for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        }

        for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        }
        System.out.println("\n" + t);

        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int a[] = new int[n]; a new int[n] n for(int i = 0;i < n;i++)a[i] = scan.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = scan.nextInt(); a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan int t = 0; t 0 for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        } {
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        } int minj = i; minj i for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            } int j = i; int j = i; j i j < n j n j++ j++ j {
                if(a[j] < a[minj])minj = j;
            } {
                if(a[j] < a[minj])minj = j;
            } 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){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            } i != minj i minj {
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            } int x = a[i]; x a[i] a i a[i] = a[minj] a[i] a i a[minj] a minj a[minj] = x a[minj] a minj x t++ t for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        } {
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        } if(i != 0)System.out.print(" "); i != 0 i 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(a[i]) System.out.print System.out System System.out a[i] a i System.out.println("\n" + t) System.out.println System.out System System.out "\n" + t "\n" t scan.close() scan.close scan String... args args public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a[] = new int[n];
        for(int i = 0;i < n;i++)a[i] = scan.nextInt();

        int t = 0; 
        for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        }

        for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        }
        System.out.println("\n" + t);

        scan.close();
    }

} public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a[] = new int[n];
        for(int i = 0;i < n;i++)a[i] = scan.nextInt();

        int t = 0; 
        for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        }

        for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        }
        System.out.println("\n" + t);

        scan.close();
    }

} Main

import java.util.Scanner;

public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a[] = new int[n];
        for(int i = 0;i < n;i++)a[i] = scan.nextInt();

        int t = 0; 
        for(int i = 0;i < n;i++){
            int minj = i;
            for(int j = i;j < n;j++){
                if(a[j] < a[minj])minj = j;
            }
            if(i != minj){
                int x = a[i];
                a[i] = a[minj];
                a[minj] = x;
                t++;
            }
        }

        for(int i = 0;i < n;i++){
            if(i != 0)System.out.print(" ");
            System.out.print(a[i]);
        }
        System.out.println("\n" + t);

        scan.close();
    }

}
