import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String[] str = new String[2];
        int count = 0;
        while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        }
        Integer number = Integer.parseInt(str[0]);
        String[] split = str[1].split(" ");
        int[] facter; 
        facter = new int[split.length];
        
        for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        }
        System.out.println("");

        
        for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        }
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String[] str = new String[2];
        int count = 0;
        while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        }
        Integer number = Integer.parseInt(str[0]);
        String[] split = str[1].split(" ");
        int[] facter; 
        facter = new int[split.length];
        
        for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        }
        System.out.println("");

        
        for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        }
	}

} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String[] str = new String[2];
        int count = 0;
        while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        }
        Integer number = Integer.parseInt(str[0]);
        String[] split = str[1].split(" ");
        int[] facter; 
        facter = new int[split.length];
        
        for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        }
        System.out.println("");

        
        for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        }
	} main {
		Scanner in = new Scanner(System.in);
        String[] str = new String[2];
        int count = 0;
        while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        }
        Integer number = Integer.parseInt(str[0]);
        String[] split = str[1].split(" ");
        int[] facter; 
        facter = new int[split.length];
        
        for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        }
        System.out.println("");

        
        for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        }
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String[] str = new String[2]; str new String[2] 2 int count = 0; count 0 while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        } in.hasNext() in.hasNext in {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        } String buf = in.nextLine(); buf in.nextLine() in.nextLine in str[count] = buf str[count] str count buf count++ count Integer number = Integer.parseInt(str[0]); number Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 String[] split = str[1].split(" "); split str[1].split(" ") str[1].split str[1] str 1 " " int[] facter; facter facter = new int[split.length] facter new int[split.length] split.length split split.length for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        } int i = 0; int i = 0; i 0 i < split.length i split.length split split.length i++ i++ i {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        } {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        } if (i != 0) {
        		System.out.print(" ");
        	} i != 0 i 0 {
        		System.out.print(" ");
        	} System.out.print(" ") System.out.print System.out System System.out " " facter[i] = Integer.parseInt(split[i]) facter[i] facter i Integer.parseInt(split[i]) Integer.parseInt Integer split[i] split i System.out.print(facter[i]) System.out.print System.out System System.out facter[i] facter i System.out.println("") System.out.println System.out System System.out "" for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        } int i = 1; int i = 1; i 1 i <= (number -1) i (number -1) number 1 i++ i++ i {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        } {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        } int v = facter[i]; v facter[i] facter i int j = i - 1; j i - 1 i 1 while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	} (j >= 0) && (facter[j] > v) (j >= 0) j 0 (facter[j] > v) facter[j] facter j v {
        		facter[j + 1] = facter[j];
        		j--;
        	} facter[j + 1] = facter[j] facter[j + 1] facter j + 1 j 1 facter[j] facter j j-- j facter[j + 1] = v facter[j + 1] facter j + 1 j 1 v for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	} int t = 0; int t = 0; t 0 t < split.length t split.length split split.length t++ t++ t {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	} {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	} if (t != 0) {
        			System.out.print(" ");
        		} t != 0 t 0 {
        			System.out.print(" ");
        		} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(facter[t]) System.out.print System.out System System.out facter[t] facter t System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String[] str = new String[2];
        int count = 0;
        while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        }
        Integer number = Integer.parseInt(str[0]);
        String[] split = str[1].split(" ");
        int[] facter; 
        facter = new int[split.length];
        
        for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        }
        System.out.println("");

        
        for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        }
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String[] str = new String[2];
        int count = 0;
        while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        }
        Integer number = Integer.parseInt(str[0]);
        String[] split = str[1].split(" ");
        int[] facter; 
        facter = new int[split.length];
        
        for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        }
        System.out.println("");

        
        for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        }
	}

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String[] str = new String[2];
        int count = 0;
        while(in.hasNext()) {
            String buf = in.nextLine();
            str[count] = buf;
            count++;
        }
        Integer number = Integer.parseInt(str[0]);
        String[] split = str[1].split(" ");
        int[] facter; 
        facter = new int[split.length];
        
        for (int i = 0; i < split.length; i++) {
        	if (i != 0) {
        		System.out.print(" ");
        	}
        	facter[i] = Integer.parseInt(split[i]);
        	System.out.print(facter[i]);
        }
        System.out.println("");

        
        for (int i = 1; i <= (number -1); i++) {
        	int v = facter[i];
        	int j = i - 1;
        	
        	while ((j >= 0) && (facter[j] > v)) {
        		facter[j + 1] = facter[j];
        		j--;
        	}
        	facter[j + 1] = v;
        	
        	for ( int t = 0; t < split.length; t++) {
        		if (t != 0) {
        			System.out.print(" ");
        		}
        		System.out.print(facter[t]);
        	}
        	System.out.println("");

        	
        }
	}

}