import java.util.Scanner;


public class Main{

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int[] values = new int[a];
		String sr[] = new String[a];
		String str = "";

		for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		}
		String disp = "";
		for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		}
		System.out.println(disp);
		solve(values);
	}

	public static void solve(int[] values) {
		for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int[] values = new int[a];
		String sr[] = new String[a];
		String str = "";

		for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		}
		String disp = "";
		for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		}
		System.out.println(disp);
		solve(values);
	}

	public static void solve(int[] values) {
		for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		}
	}
} Main public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int[] values = new int[a];
		String sr[] = new String[a];
		String str = "";

		for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		}
		String disp = "";
		for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		}
		System.out.println(disp);
		solve(values);
	} main {

		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int[] values = new int[a];
		String sr[] = new String[a];
		String str = "";

		for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		}
		String disp = "";
		for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		}
		System.out.println(disp);
		solve(values);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int a = s.nextInt(); a s.nextInt() s.nextInt s int[] values = new int[a]; values new int[a] a String sr[] = new String[a]; sr new String[a] a String str = ""; str "" for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		} int i=0 ; int i=0 ; i 0 i<sr.length i sr.length sr sr.length i++ i++ i {
			values[i] = s.nextInt();
		} {
			values[i] = s.nextInt();
		} values[i] = s.nextInt() values[i] values i s.nextInt() s.nextInt s String disp = ""; disp "" for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		} int j=0 ; int j=0 ; j 0 j<values.length j values.length values values.length j++ j++ j {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		} {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		} disp += values[j] disp values[j] values j if(j+1<values.length)
				disp += " "; j+1<values.length j+1 j 1 values.length values values.length disp += " " disp " " System.out.println(disp) System.out.println System.out System System.out disp solve(values) solve values String[] args args public static void solve(int[] values) {
		for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		}
	} solve {
		for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		}
	} for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		} int i=1 ; int i=1 ; i 1 i<values.length i values.length values values.length i++ i++ i {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		} {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		} int targetV = values[i]; targetV values[i] values i int movableIndex = i - 1; movableIndex i - 1 i 1 while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			} movableIndex >= 0 && values[movableIndex] > targetV movableIndex >= 0 movableIndex 0 values[movableIndex] > targetV values[movableIndex] values movableIndex targetV {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			} values[movableIndex + 1] = values[movableIndex] values[movableIndex + 1] values movableIndex + 1 movableIndex 1 values[movableIndex] values movableIndex movableIndex-- movableIndex values[movableIndex + 1] = targetV values[movableIndex + 1] values movableIndex + 1 movableIndex 1 targetV String disp = ""; disp "" for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			} int j=0 ; int j=0 ; j 0 j<values.length j values.length values values.length j++ j++ j {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			} {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			} disp += values[j] disp values[j] values j if(j+1<values.length)
					disp += " "; j+1<values.length j+1 j 1 values.length values values.length disp += " " disp " " System.out.println(disp) System.out.println System.out System System.out disp int[] values values public class Main{

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int[] values = new int[a];
		String sr[] = new String[a];
		String str = "";

		for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		}
		String disp = "";
		for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		}
		System.out.println(disp);
		solve(values);
	}

	public static void solve(int[] values) {
		for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		}
	}
} public class Main{

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int[] values = new int[a];
		String sr[] = new String[a];
		String str = "";

		for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		}
		String disp = "";
		for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		}
		System.out.println(disp);
		solve(values);
	}

	public static void solve(int[] values) {
		for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		}
	}
} Main
import java.util.Scanner;


public class Main{

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int[] values = new int[a];
		String sr[] = new String[a];
		String str = "";

		for(int i=0 ; i<sr.length ; i++) {
			values[i] = s.nextInt();
		}
		String disp = "";
		for(int j=0 ; j<values.length ; j++) {
			disp += values[j];
			if(j+1<values.length)
				disp += " ";
		}
		System.out.println(disp);
		solve(values);
	}

	public static void solve(int[] values) {
		for(int i=1 ; i<values.length ; i++) {
			int targetV = values[i];
			int movableIndex = i - 1;
			while(movableIndex >= 0 && values[movableIndex] > targetV) {
				values[movableIndex + 1] = values[movableIndex];
				movableIndex--;
			}
			values[movableIndex + 1] = targetV;
			String disp = "";
			for(int j=0 ; j<values.length ; j++) {
				disp += values[j];
				if(j+1<values.length)
					disp += " ";
			}
			System.out.println(disp);
		}
	}
}