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

public class Main {

	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int seriesNum = Integer.parseInt(br.readLine());
		String[] series = br.readLine().split(" ");
		int[] cardNumberResult = new int[seriesNum];

		for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		}
		for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int seriesNum = Integer.parseInt(br.readLine());
		String[] series = br.readLine().split(" ");
		int[] cardNumberResult = new int[seriesNum];

		for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		}
		for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		}
	}
} Main public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	} printArray {
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	} for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < intArray.length i intArray.length intArray intArray.length i++ i++ i {
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		} {
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		} System.out.print(intArray[i]) System.out.print System.out System System.out intArray[i] intArray i if (i == intArray.length - 1){
				break;
			} i == intArray.length - 1 i intArray.length - 1 intArray.length intArray intArray.length 1 {
				break;
			} break; System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int[] intArray intArray public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int seriesNum = Integer.parseInt(br.readLine());
		String[] series = br.readLine().split(" ");
		int[] cardNumberResult = new int[seriesNum];

		for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		}
		for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		}
	} main {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int seriesNum = Integer.parseInt(br.readLine());
		String[] series = br.readLine().split(" ");
		int[] cardNumberResult = new int[seriesNum];

		for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		}
		for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		}
	} BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); br new BufferedReader (new InputStreamReader(System.in)) int seriesNum = Integer.parseInt(br.readLine()); seriesNum Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] series = br.readLine().split(" "); series br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] cardNumberResult = new int[seriesNum]; cardNumberResult new int[seriesNum] seriesNum for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		} int i = 0; int i = 0; i 0 i < seriesNum i seriesNum i++ i++ i {
			cardNumberResult[i] = Integer.parseInt(series[i]);
		} {
			cardNumberResult[i] = Integer.parseInt(series[i]);
		} cardNumberResult[i] = Integer.parseInt(series[i]) cardNumberResult[i] cardNumberResult i Integer.parseInt(series[i]) Integer.parseInt Integer series[i] series i for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		} int i = 0; int i = 0; i 0 i < seriesNum i seriesNum i++ i++ i {
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		} {
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		} if (i == 0){
				printArray(cardNumberResult);
			} i == 0 i 0 {
				printArray(cardNumberResult);
			} printArray(cardNumberResult) printArray cardNumberResult if (i == seriesNum -1){
				break;
			} i == seriesNum -1 i seriesNum -1 seriesNum 1 {
				break;
			} break; for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			} int j = i + 1; int j = i + 1; j i + 1 i 1 0 < j 0 j j-- j-- j {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			} {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			} if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				} cardNumberResult[j] < cardNumberResult[j - 1] cardNumberResult[j] cardNumberResult j cardNumberResult[j - 1] cardNumberResult j - 1 j 1 {
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				} int tmp = cardNumberResult[j - 1]; tmp cardNumberResult[j - 1] cardNumberResult j - 1 j 1 cardNumberResult[j - 1] = cardNumberResult[j] cardNumberResult[j - 1] cardNumberResult j - 1 j 1 cardNumberResult[j] cardNumberResult j cardNumberResult[j] = tmp cardNumberResult[j] cardNumberResult j tmp {
					break;
				} break; printArray(cardNumberResult) printArray cardNumberResult String[] args args public class Main {

	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int seriesNum = Integer.parseInt(br.readLine());
		String[] series = br.readLine().split(" ");
		int[] cardNumberResult = new int[seriesNum];

		for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		}
		for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		}
	}
} public class Main {

	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int seriesNum = Integer.parseInt(br.readLine());
		String[] series = br.readLine().split(" ");
		int[] cardNumberResult = new int[seriesNum];

		for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		}
		for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int seriesNum = Integer.parseInt(br.readLine());
		String[] series = br.readLine().split(" ");
		int[] cardNumberResult = new int[seriesNum];

		for (int i = 0; i < seriesNum; i++){
			cardNumberResult[i] = Integer.parseInt(series[i]);
		}
		for (int i = 0; i < seriesNum; i++){
			if (i == 0){
				printArray(cardNumberResult);
			}
			
			if (i == seriesNum -1){
				break;
			}
			for (int j = i + 1; 0 < j ; j--) {

				if (cardNumberResult[j] < cardNumberResult[j - 1]){
					int tmp = cardNumberResult[j - 1];
					cardNumberResult[j - 1] = cardNumberResult[j];
					cardNumberResult[j] = tmp;
				}
				else {
					break;
				}
			}
			printArray(cardNumberResult);
		}
	}
}