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

//?????\?????????
public class Main{

	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		int n = readInt(r);
		String[] numArrayStr = r.readLine().split(" ");

		int[] numArrayInt = new int[n];
		for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		}

		printBlank(numArrayInt);

		for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		}

	}

	public static int readInt(BufferedReader r) throws Exception{
        return Integer.parseInt(r.readLine());
    }

	public static void printBlank(int[] numArrayInt){
		StringBuilder builder = new StringBuilder();
		for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		}

		System.out.println(builder.toString().trim());
	}

} 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 {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		int n = readInt(r);
		String[] numArrayStr = r.readLine().split(" ");

		int[] numArrayInt = new int[n];
		for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		}

		printBlank(numArrayInt);

		for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		}

	}

	public static int readInt(BufferedReader r) throws Exception{
        return Integer.parseInt(r.readLine());
    }

	public static void printBlank(int[] numArrayInt){
		StringBuilder builder = new StringBuilder();
		for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		}

		System.out.println(builder.toString().trim());
	}

} Main public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		int n = readInt(r);
		String[] numArrayStr = r.readLine().split(" ");

		int[] numArrayInt = new int[n];
		for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		}

		printBlank(numArrayInt);

		for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		}

	} main {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		int n = readInt(r);
		String[] numArrayStr = r.readLine().split(" ");

		int[] numArrayInt = new int[n];
		for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		}

		printBlank(numArrayInt);

		for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		}

	} BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); r new BufferedReader(new InputStreamReader(System.in)) int n = readInt(r); n readInt(r) readInt r String[] numArrayStr = r.readLine().split(" "); numArrayStr r.readLine().split(" ") r.readLine().split r.readLine() r.readLine r " " int[] numArrayInt = new int[n]; numArrayInt new int[n] n for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		} {
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		} numArrayInt[i] = Integer.parseInt(numArrayStr[i]) numArrayInt[i] numArrayInt i Integer.parseInt(numArrayStr[i]) Integer.parseInt Integer numArrayStr[i] numArrayStr i printBlank(numArrayInt) printBlank numArrayInt for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		} int y = 1; int y = 1; y 1 y < n y n y++ y++ y {
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		} {
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		} int kijun = numArrayInt[y]; kijun numArrayInt[y] numArrayInt y int j = y - 1; j y - 1 y 1 while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			} j >= 0 && numArrayInt[j] > kijun j >= 0 j 0 numArrayInt[j] > kijun numArrayInt[j] numArrayInt j kijun {
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			} numArrayInt[j + 1] = numArrayInt[j] numArrayInt[j + 1] numArrayInt j + 1 j 1 numArrayInt[j] numArrayInt j j-- j numArrayInt[j + 1] = kijun numArrayInt[j + 1] numArrayInt j + 1 j 1 kijun printBlank(numArrayInt) printBlank numArrayInt String[] args args public static int readInt(BufferedReader r) throws Exception{
        return Integer.parseInt(r.readLine());
    } readInt {
        return Integer.parseInt(r.readLine());
    } return Integer.parseInt(r.readLine()); Integer.parseInt(r.readLine()) Integer.parseInt Integer r.readLine() r.readLine r BufferedReader r r public static void printBlank(int[] numArrayInt){
		StringBuilder builder = new StringBuilder();
		for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		}

		System.out.println(builder.toString().trim());
	} printBlank {
		StringBuilder builder = new StringBuilder();
		for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		}

		System.out.println(builder.toString().trim());
	} StringBuilder builder = new StringBuilder(); builder new StringBuilder() for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		} int i = 0; int i = 0; i 0 i < numArrayInt.length i numArrayInt.length numArrayInt numArrayInt.length i++ i++ i {
			builder.append(numArrayInt[i]);
			builder.append(" ");
		} {
			builder.append(numArrayInt[i]);
			builder.append(" ");
		} builder.append(numArrayInt[i]) builder.append builder numArrayInt[i] numArrayInt i builder.append(" ") builder.append builder " " System.out.println(builder.toString().trim()) System.out.println System.out System System.out builder.toString().trim() builder.toString().trim builder.toString() builder.toString builder int[] numArrayInt numArrayInt public class Main{

	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		int n = readInt(r);
		String[] numArrayStr = r.readLine().split(" ");

		int[] numArrayInt = new int[n];
		for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		}

		printBlank(numArrayInt);

		for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		}

	}

	public static int readInt(BufferedReader r) throws Exception{
        return Integer.parseInt(r.readLine());
    }

	public static void printBlank(int[] numArrayInt){
		StringBuilder builder = new StringBuilder();
		for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		}

		System.out.println(builder.toString().trim());
	}

} public class Main{

	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		int n = readInt(r);
		String[] numArrayStr = r.readLine().split(" ");

		int[] numArrayInt = new int[n];
		for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		}

		printBlank(numArrayInt);

		for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		}

	}

	public static int readInt(BufferedReader r) throws Exception{
        return Integer.parseInt(r.readLine());
    }

	public static void printBlank(int[] numArrayInt){
		StringBuilder builder = new StringBuilder();
		for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		}

		System.out.println(builder.toString().trim());
	}

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

//?????\?????????
public class Main{

	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		int n = readInt(r);
		String[] numArrayStr = r.readLine().split(" ");

		int[] numArrayInt = new int[n];
		for(int i = 0; i < n; i++){
			numArrayInt[i] = Integer.parseInt(numArrayStr[i]);
		}

		printBlank(numArrayInt);

		for(int y = 1; y < n; y++){
			int kijun = numArrayInt[y];
			int j = y - 1;
			while(j >= 0 && numArrayInt[j] > kijun){
				numArrayInt[j + 1] = numArrayInt[j];
				j--;
			}
			numArrayInt[j + 1] = kijun;
			printBlank(numArrayInt);
		}

	}

	public static int readInt(BufferedReader r) throws Exception{
        return Integer.parseInt(r.readLine());
    }

	public static void printBlank(int[] numArrayInt){
		StringBuilder builder = new StringBuilder();
		for(int i = 0; i < numArrayInt.length; i++){
			builder.append(numArrayInt[i]);
			builder.append(" ");
		}

		System.out.println(builder.toString().trim());
	}

}