import java.io.*;

class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			int n = Integer.parseInt( kb.readLine() );
			String[] nums = kb.readLine().split( " " );
			int len = nums.length;
			int[] A = new int[ len ];
			int i, len2 = len-1;

			StringBuilder output = new StringBuilder( 100+1 );									
			for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			}
			System.out.println( output  );
			output.setLength( 0 );

			int key;
			int j, k;
 			for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			}
			
 			kb.close();
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			int n = Integer.parseInt( kb.readLine() );
			String[] nums = kb.readLine().split( " " );
			int len = nums.length;
			int[] A = new int[ len ];
			int i, len2 = len-1;

			StringBuilder output = new StringBuilder( 100+1 );									
			for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			}
			System.out.println( output  );
			output.setLength( 0 );

			int key;
			int j, k;
 			for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			}
			
 			kb.close();
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
} Main public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			int n = Integer.parseInt( kb.readLine() );
			String[] nums = kb.readLine().split( " " );
			int len = nums.length;
			int[] A = new int[ len ];
			int i, len2 = len-1;

			StringBuilder output = new StringBuilder( 100+1 );									
			for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			}
			System.out.println( output  );
			output.setLength( 0 );

			int key;
			int j, k;
 			for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			}
			
 			kb.close();
		} catch( IOException e ) {
			System.err.println( e );
		}
	} main {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			int n = Integer.parseInt( kb.readLine() );
			String[] nums = kb.readLine().split( " " );
			int len = nums.length;
			int[] A = new int[ len ];
			int i, len2 = len-1;

			StringBuilder output = new StringBuilder( 100+1 );									
			for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			}
			System.out.println( output  );
			output.setLength( 0 );

			int key;
			int j, k;
 			for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			}
			
 			kb.close();
		} catch( IOException e ) {
			System.err.println( e );
		}
	} BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) ); kb new BufferedReader( new InputStreamReader( System.in ) ) try {
			int n = Integer.parseInt( kb.readLine() );
			String[] nums = kb.readLine().split( " " );
			int len = nums.length;
			int[] A = new int[ len ];
			int i, len2 = len-1;

			StringBuilder output = new StringBuilder( 100+1 );									
			for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			}
			System.out.println( output  );
			output.setLength( 0 );

			int key;
			int j, k;
 			for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			}
			
 			kb.close();
		} catch( IOException e ) {
			System.err.println( e );
		} catch( IOException e ) {
			System.err.println( e );
		} IOException e {
			System.err.println( e );
		} System.err.println( e ) System.err.println System.err System System.err e {
			int n = Integer.parseInt( kb.readLine() );
			String[] nums = kb.readLine().split( " " );
			int len = nums.length;
			int[] A = new int[ len ];
			int i, len2 = len-1;

			StringBuilder output = new StringBuilder( 100+1 );									
			for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			}
			System.out.println( output  );
			output.setLength( 0 );

			int key;
			int j, k;
 			for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			}
			
 			kb.close();
		} int n = Integer.parseInt( kb.readLine() ); n Integer.parseInt( kb.readLine() ) Integer.parseInt Integer kb.readLine() kb.readLine kb String[] nums = kb.readLine().split( " " ); nums kb.readLine().split( " " ) kb.readLine().split kb.readLine() kb.readLine kb " " int len = nums.length; len nums.length nums nums.length int[] A = new int[ len ]; A new int[ len ] len int i i len2 = len-1; len2 len-1 len 1 StringBuilder output = new StringBuilder( 100+1 ); output new StringBuilder( 100+1 ) for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			} i=0; i=0 i 0 i<len i len i++ i++ i {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			} {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			} A[i] = Integer.parseInt( nums[i] ) A[i] A i Integer.parseInt( nums[i] ) Integer.parseInt Integer nums[i] nums i output.append( i<(len2)? A[i]+" ": A[i]  ) output.append output i<(len2)? A[i]+" ": A[i] i<(len2) i (len2) A[i]+" " A[i] A i " " A[i] A i System.out.println( output  ) System.out.println System.out System System.out output output.setLength( 0 ) output.setLength output 0 int key; key int j j k; k for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			} i=1; i=1 i 1 i<len i len i++ i++ i {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			} {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			} key = A[i] key A[i] A i j = i - 1 j i - 1 i 1 while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				} 0 <= j && key < A[j] 0 <= j 0 j key < A[j] key A[j] A j {
					A[ j+1 ] = A[j];
					j--;
				} A[ j+1 ] = A[j] A[ j+1 ] A j+1 j 1 A[j] A j j-- j A[ j+1 ] = key A[ j+1 ] A j+1 j 1 key for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				} k=0; k=0 k 0 k<len k len k++ k++ k {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				} {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				} output.append( k<(len2)? A[k]+" ": A[k]  ) output.append output k<(len2)? A[k]+" ": A[k] k<(len2) k (len2) A[k]+" " A[k] A k " " A[k] A k System.out.println( output  ) System.out.println System.out System System.out output output.setLength( 0 ) output.setLength output 0 kb.close() kb.close kb String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			int n = Integer.parseInt( kb.readLine() );
			String[] nums = kb.readLine().split( " " );
			int len = nums.length;
			int[] A = new int[ len ];
			int i, len2 = len-1;

			StringBuilder output = new StringBuilder( 100+1 );									
			for( i=0; i<len; i++ ) {
				A[i] = Integer.parseInt( nums[i] );
				output.append( i<(len2)? A[i]+" ": A[i]  );
			}
			System.out.println( output  );
			output.setLength( 0 );

			int key;
			int j, k;
 			for( i=1; i<len; i++ ) {
				key = A[i];
				j = i - 1;
				while( 0 <= j && key < A[j] ) {
					A[ j+1 ] = A[j];
					j--;
				}
				A[ j+1 ] = key;
				for( k=0; k<len; k++ ) {
					output.append( k<(len2)? A[k]+" ": A[k]  );
				}
				System.out.println( output  );
				output.setLength( 0 );
			}
			
 			kb.close();
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
}