import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int n = getInt(breader);
		int[] ary = getAry(breader);
		putAry(ary);
		for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int getInt(BufferedReader br)throws Exception {
		String line = br.readLine();
		return Integer.valueOf(line);
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}
	public static void putAry(int[] ary) {
		for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int n = getInt(breader);
		int[] ary = getAry(breader);
		putAry(ary);
		for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int getInt(BufferedReader br)throws Exception {
		String line = br.readLine();
		return Integer.valueOf(line);
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}
	public static void putAry(int[] ary) {
		for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	}

} Main public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int n = getInt(breader);
		int[] ary = getAry(breader);
		putAry(ary);
		for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		}
	} main {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int n = getInt(breader);
		int[] ary = getAry(breader);
		putAry(ary);
		for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		}
	} BufferedReader breader = getReader(); breader getReader() getReader int n = getInt(breader); n getInt(breader) getInt breader int[] ary = getAry(breader); ary getAry(breader) getAry breader putAry(ary) putAry ary for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		} int i = 1 ; int i = 1 ; i 1 i < ary.length i ary.length ary ary.length i++ i++ i {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		} {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		} int key = ary[i] ; key ary[i] ary i int j = i - 1; j i - 1 i 1 while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			} j >= 0 && ary[j] > key j >= 0 j 0 ary[j] > key ary[j] ary j key {
				ary[j+1] = ary[j] ;
				j--;
			} ary[j+1] = ary[j] ary[j+1] ary j+1 j 1 ary[j] ary j j-- j ary[j+1] = key ary[j+1] ary j+1 j 1 key putAry(ary) putAry ary String[] args args public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	} getReader {
		return( new BufferedReader(new InputStreamReader(System.in)));
	} return( new BufferedReader(new InputStreamReader(System.in))); ( new BufferedReader(new InputStreamReader(System.in))) public static int getInt(BufferedReader br)throws Exception {
		String line = br.readLine();
		return Integer.valueOf(line);
	} getInt {
		String line = br.readLine();
		return Integer.valueOf(line);
	} String line = br.readLine(); line br.readLine() br.readLine br return Integer.valueOf(line); Integer.valueOf(line) Integer.valueOf Integer line BufferedReader br br public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	} getAry {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	} String line = br.readLine(); line br.readLine() br.readLine br String[] nstr = line.split(" "); nstr line.split(" ") line.split line " " int[] n = new int[nstr.length]; n new int[nstr.length] nstr.length nstr nstr.length for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		} int i=0 ; int i=0 ; i 0 i < nstr.length i nstr.length nstr nstr.length i++ i++ i {
			n[i] = Integer.valueOf(nstr[i]);
		} {
			n[i] = Integer.valueOf(nstr[i]);
		} n[i] = Integer.valueOf(nstr[i]) n[i] n i Integer.valueOf(nstr[i]) Integer.valueOf Integer nstr[i] nstr i return n; n BufferedReader br br public static void putAry(int[] ary) {
		for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	} putAry {
		for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	} for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		} int i = 0; int i = 0; i 0 i < ary.length i ary.length ary ary.length i++ i++ i {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		} {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		} System.out.print(ary[i]) System.out.print System.out System System.out ary[i] ary i if ( i < ary.length-1) {
				System.out.print(" ");
			} i < ary.length-1 i ary.length-1 ary.length ary ary.length 1 {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " System.out.println("") System.out.println System.out System System.out "" int[] ary ary public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int n = getInt(breader);
		int[] ary = getAry(breader);
		putAry(ary);
		for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int getInt(BufferedReader br)throws Exception {
		String line = br.readLine();
		return Integer.valueOf(line);
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}
	public static void putAry(int[] ary) {
		for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	}

} public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int n = getInt(breader);
		int[] ary = getAry(breader);
		putAry(ary);
		for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int getInt(BufferedReader br)throws Exception {
		String line = br.readLine();
		return Integer.valueOf(line);
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}
	public static void putAry(int[] ary) {
		for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int n = getInt(breader);
		int[] ary = getAry(breader);
		putAry(ary);
		for( int i = 1 ; i < ary.length ; i++) {
			int key = ary[i] ;
			int j = i - 1;
			while( j >= 0 && ary[j] > key ) {
				ary[j+1] = ary[j] ;
				j--;
			}
			ary[j+1] = key;
			putAry(ary);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int getInt(BufferedReader br)throws Exception {
		String line = br.readLine();
		return Integer.valueOf(line);
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}
	public static void putAry(int[] ary) {
		for( int i = 0; i < ary.length ; i++ ) {
			System.out.print(ary[i]);
			if ( i < ary.length-1) {
				System.out.print(" ");
			}
		}
		System.out.println("");
	}

}