
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			//?????????????????????
			int leng = Integer.parseInt(sc.nextLine());
			int[] numBox = new int[leng];

			//??°??????????????????
			String line = sc.nextLine();
			String[] list = line.split(" ");
			//???????????????
			for (int i = 0; i < numBox.length; i++) {
				numBox[i] = Integer.parseInt(list[i]);
			}
			//???????????????????????????
			for (int i2 = 0; i2 < numBox.length; i2++) {

				//??????????????´??°?????????
				int work = numBox[i2];
				//while
				int j = i2 -1;
				while (j >= 0 && numBox[j] > work) {
					numBox[j +1] = numBox[j];
					j--;
				}
				//??\?????????
				numBox[j + 1] = work;
				//???????????????
				for (int i = 0; i < numBox.length; i++) {
					System.out.print(numBox[i]);

					//???????????????????????°???????????\??????
					if (i != numBox.length - 1) {
						System.out.print(" ");
					}
				}
				//??????
				System.out.println("");
			}

		}catch (NumberFormatException e) {
			System.out.println(e);
		} finally {
			if (sc != null) {
				sc.close();
			}
		}
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz