import java.util.Scanner;
public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	//input elements
	int n = Integer.parseInt(scan.nextLine());
	String[] inputs = scan.nextLine().split(" ");
	int[] cards = new int[n];
	for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	}

	//insertion sort
	for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	}
	//show cards
	printArray(cards);
    }
    static void printArray(int[] a){
	for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	}
	System.out.println(a[a.length-1]);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	//input elements
	int n = Integer.parseInt(scan.nextLine());
	String[] inputs = scan.nextLine().split(" ");
	int[] cards = new int[n];
	for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	}

	//insertion sort
	for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	}
	//show cards
	printArray(cards);
    }
    static void printArray(int[] a){
	for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	}
	System.out.println(a[a.length-1]);
    }
} Main public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	//input elements
	int n = Integer.parseInt(scan.nextLine());
	String[] inputs = scan.nextLine().split(" ");
	int[] cards = new int[n];
	for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	}

	//insertion sort
	for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	}
	//show cards
	printArray(cards);
    } main {
	Scanner scan = new Scanner(System.in);

	//input elements
	int n = Integer.parseInt(scan.nextLine());
	String[] inputs = scan.nextLine().split(" ");
	int[] cards = new int[n];
	for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	}

	//insertion sort
	for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	}
	//show cards
	printArray(cards);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = Integer.parseInt(scan.nextLine()); n Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan String[] inputs = scan.nextLine().split(" "); inputs scan.nextLine().split(" ") scan.nextLine().split scan.nextLine() scan.nextLine scan " " int[] cards = new int[n]; cards new int[n] n for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
	    cards[i] = Integer.parseInt(inputs[i]);
	} {
	    cards[i] = Integer.parseInt(inputs[i]);
	} cards[i] = Integer.parseInt(inputs[i]) cards[i] cards i Integer.parseInt(inputs[i]) Integer.parseInt Integer inputs[i] inputs i for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	} {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	} printArray(cards) printArray cards int key = cards[i]; key cards[i] cards i int j = i - 1; j i - 1 i 1 while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    } j >= 0 && cards[j] > key j >= 0 j 0 cards[j] > key cards[j] cards j key {
		cards[j+1] = cards[j];
		j--;
	    } cards[j+1] = cards[j] cards[j+1] cards j+1 j 1 cards[j] cards j j-- j cards[j+1] = key cards[j+1] cards j+1 j 1 key printArray(cards) printArray cards String[] args args static void printArray(int[] a){
	for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	}
	System.out.println(a[a.length-1]);
    } printArray {
	for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	}
	System.out.println(a[a.length-1]);
    } for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	} int i = 0; int i = 0; i 0 i < a.length-1 i a.length-1 a.length a a.length 1 i++ i++ i {
	    System.out.print(a[i] + " ");
	} {
	    System.out.print(a[i] + " ");
	} System.out.print(a[i] + " ") System.out.print System.out System System.out a[i] + " " a[i] a i " " System.out.println(a[a.length-1]) System.out.println System.out System System.out a[a.length-1] a a.length-1 a.length a a.length 1 int[] a a public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	//input elements
	int n = Integer.parseInt(scan.nextLine());
	String[] inputs = scan.nextLine().split(" ");
	int[] cards = new int[n];
	for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	}

	//insertion sort
	for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	}
	//show cards
	printArray(cards);
    }
    static void printArray(int[] a){
	for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	}
	System.out.println(a[a.length-1]);
    }
} public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	//input elements
	int n = Integer.parseInt(scan.nextLine());
	String[] inputs = scan.nextLine().split(" ");
	int[] cards = new int[n];
	for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	}

	//insertion sort
	for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	}
	//show cards
	printArray(cards);
    }
    static void printArray(int[] a){
	for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	}
	System.out.println(a[a.length-1]);
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	//input elements
	int n = Integer.parseInt(scan.nextLine());
	String[] inputs = scan.nextLine().split(" ");
	int[] cards = new int[n];
	for (int i = 0; i < n; i++) {
	    cards[i] = Integer.parseInt(inputs[i]);
	}

	//insertion sort
	for (int i = 1; i < n; i++) {
	    //show cards
	    printArray(cards);
	    int key = cards[i];
	    int j = i - 1;
	    while (j >= 0 && cards[j] > key) {
		cards[j+1] = cards[j];
		j--;
	    }
	    cards[j+1] = key;
	}
	//show cards
	printArray(cards);
    }
    static void printArray(int[] a){
	for (int i = 0; i < a.length-1; i++) {
	    System.out.print(a[i] + " ");
	}
	System.out.println(a[a.length-1]);
    }
}