import java.util.Scanner;

public class Main {

	public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
        // 配列の要素数は先に入れさせる
        int N = sc.nextInt();
        int []A = new int[N];
        //各配列の数を入れる
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
		for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		}
        out_put(A);
    }

	private static void out_put(int array[]){

        System.out.printf("%d", array[0]);

        for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        }
        System.out.printf("\n");
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
        // 配列の要素数は先に入れさせる
        int N = sc.nextInt();
        int []A = new int[N];
        //各配列の数を入れる
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
		for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		}
        out_put(A);
    }

	private static void out_put(int array[]){

        System.out.printf("%d", array[0]);

        for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        }
        System.out.printf("\n");
    }
} Main public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
        // 配列の要素数は先に入れさせる
        int N = sc.nextInt();
        int []A = new int[N];
        //各配列の数を入れる
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
		for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		}
        out_put(A);
    } main {
        Scanner sc = new Scanner(System.in);
        // 配列の要素数は先に入れさせる
        int N = sc.nextInt();
        int []A = new int[N];
        //各配列の数を入れる
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
		for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		}
        out_put(A);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int []A = new int[N]; A new int[N] N for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            A[i] = sc.nextInt();
        } {
            A[i] = sc.nextInt();
        } A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		} {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		} out_put(A) out_put A int j; j int tmp = A[i]; tmp A[i] A i for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1]; j = i; j = i j i j > 0 && A[j - 1] > tmp j > 0 j 0 A[j - 1] > tmp A[j - 1] A j - 1 j 1 tmp j-- j-- j A[j] = A[j-1]; A[j] = A[j-1] A[j] A j A[j-1] A j-1 j 1 A[j] = tmp A[j] A j tmp out_put(A) out_put A String args[] args private static void out_put(int array[]){

        System.out.printf("%d", array[0]);

        for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        }
        System.out.printf("\n");
    } out_put {

        System.out.printf("%d", array[0]);

        for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        }
        System.out.printf("\n");
    } System.out.printf("%d", array[0]) System.out.printf System.out System System.out "%d" array[0] array 0 for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        } int i = 1; int i = 1; i 1 i < array.length i array.length array array.length i++ i++ i {
            System.out.printf(" %d", array[i]);
        } {
            System.out.printf(" %d", array[i]);
        } System.out.printf(" %d", array[i]) System.out.printf System.out System System.out " %d" array[i] array i System.out.printf("\n") System.out.printf System.out System System.out "\n" int array[] array public class Main {

	public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
        // 配列の要素数は先に入れさせる
        int N = sc.nextInt();
        int []A = new int[N];
        //各配列の数を入れる
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
		for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		}
        out_put(A);
    }

	private static void out_put(int array[]){

        System.out.printf("%d", array[0]);

        for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        }
        System.out.printf("\n");
    }
} public class Main {

	public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
        // 配列の要素数は先に入れさせる
        int N = sc.nextInt();
        int []A = new int[N];
        //各配列の数を入れる
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
		for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		}
        out_put(A);
    }

	private static void out_put(int array[]){

        System.out.printf("%d", array[0]);

        for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        }
        System.out.printf("\n");
    }
} Main
import java.util.Scanner;

public class Main {

	public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
        // 配列の要素数は先に入れさせる
        int N = sc.nextInt();
        int []A = new int[N];
        //各配列の数を入れる
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
		for (int i = 1; i < N; i++) {
	        out_put(A);
			int j;
			int tmp = A[i];
			for(j = i;j > 0 && A[j - 1] > tmp; j--)
				A[j] = A[j-1];
			A[j] = tmp;
		}
        out_put(A);
    }

	private static void out_put(int array[]){

        System.out.printf("%d", array[0]);

        for(int i = 1; i < array.length; i++){
            System.out.printf(" %d", array[i]);
        }
        System.out.printf("\n");
    }
}

