import java.util.Arrays;
import java.util.Scanner;


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) nums[i] = sc.nextInt();

        trace(nums);
        insertionSort(n, nums);
    }

    private static void insertionSort(int n, int[] nums) {
    	int j, v;
    	for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	}
    }

    private static void trace(int[] nums) {
    	System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", ""));
    }

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) nums[i] = sc.nextInt();

        trace(nums);
        insertionSort(n, nums);
    }

    private static void insertionSort(int n, int[] nums) {
    	int j, v;
    	for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	}
    }

    private static void trace(int[] nums) {
    	System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", ""));
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) nums[i] = sc.nextInt();

        trace(nums);
        insertionSort(n, nums);
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) nums[i] = sc.nextInt();

        trace(nums);
        insertionSort(n, nums);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] nums = new int[n]; nums new int[n] n for (int i = 0; i < n; i++) nums[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i nums[i] = sc.nextInt(); nums[i] = sc.nextInt() nums[i] nums i sc.nextInt() sc.nextInt sc trace(nums) trace nums insertionSort(n, nums) insertionSort n nums String[] args args private static void insertionSort(int n, int[] nums) {
    	int j, v;
    	for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	}
    } insertionSort {
    	int j, v;
    	for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	}
    } int j j v; v for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	} {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	} v = nums[i] v nums[i] nums i j = i - 1 j i - 1 i 1 while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		} j >= 0 && nums[j] > v j >= 0 j 0 nums[j] > v nums[j] nums j v {
    			nums[j + 1] = nums[j];
    			j--;
    		} nums[j + 1] = nums[j] nums[j + 1] nums j + 1 j 1 nums[j] nums j j-- j nums[j + 1] = v nums[j + 1] nums j + 1 j 1 v trace(nums) trace nums int n n int[] nums nums private static void trace(int[] nums) {
    	System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", ""));
    } trace {
    	System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", ""));
    } System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", "")) System.out.println System.out System System.out Arrays.toString(nums).replaceAll("[\\[\\],]", "") Arrays.toString(nums).replaceAll Arrays.toString(nums) Arrays.toString Arrays nums "[\\[\\],]" "" int[] nums nums public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) nums[i] = sc.nextInt();

        trace(nums);
        insertionSort(n, nums);
    }

    private static void insertionSort(int n, int[] nums) {
    	int j, v;
    	for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	}
    }

    private static void trace(int[] nums) {
    	System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", ""));
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) nums[i] = sc.nextInt();

        trace(nums);
        insertionSort(n, nums);
    }

    private static void insertionSort(int n, int[] nums) {
    	int j, v;
    	for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	}
    }

    private static void trace(int[] nums) {
    	System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", ""));
    }

} Main
import java.util.Arrays;
import java.util.Scanner;


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) nums[i] = sc.nextInt();

        trace(nums);
        insertionSort(n, nums);
    }

    private static void insertionSort(int n, int[] nums) {
    	int j, v;
    	for (int i = 1; i < n; i++) {
    		v = nums[i];
    		j = i - 1;
    		while (j >= 0 && nums[j] > v) {
    			nums[j + 1] = nums[j];
    			j--;
    		}
    		nums[j + 1] = v;
    		trace(nums);
    	}
    }

    private static void trace(int[] nums) {
    	System.out.println(Arrays.toString(nums).replaceAll("[\\[\\],]", ""));
    }

}
