import java.util.Scanner;

public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	}
}
 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 array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	}
} Main public static void main (String [] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int array[] = new int[n]; array new int[n] n for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		} {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		} array[i] = scan.nextInt() array[i] array i scan.nextInt() scan.nextInt scan System.out.print(array[i]) System.out.print System.out System System.out array[i] array i if ( i == n - 1) break; i == n - 1 i n - 1 n 1 break; System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out scan.close() scan.close scan for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		} {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		} int v = array[i]; v array[i] array i int j = i - 1; j i - 1 i 1 while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			} j >= 0 && array[j] > v j >= 0 j 0 array[j] > v array[j] array j v {
				array[j + 1] = array[j];
				j--;
			} array[j + 1] = array[j] array[j + 1] array j + 1 j 1 array[j] array j j-- j array[j + 1] = v array[j + 1] array j + 1 j 1 v for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			} int k = 0; int k = 0; k 0 k < n k n k++ k++ k {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			} {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			} if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				} k == n - 1 k n - 1 n 1 {
					System.out.println(array[k]);
				} System.out.println(array[k]) System.out.println System.out System System.out array[k] array k {
					System.out.print(array[k] + " ");
				} System.out.print(array[k] + " ") System.out.print System.out System System.out array[k] + " " array[k] array k " " String [] args args public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	}
} public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	}
} 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 array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	}
}

