import java.util.Scanner;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int ary[]= new int[n];
		int a,b;
		for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		}

		for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		}
	}
}
 import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int ary[]= new int[n];
		int a,b;
		for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		}

		for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		}
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int ary[]= new int[n];
		int a,b;
		for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		}

		for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int ary[]= new int[n];
		int a,b;
		for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		}

		for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int ary[]= new int[n]; ary new int[n] n int a a b; b for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			ary[i]=sc.nextInt();
		} {
			ary[i]=sc.nextInt();
		} ary[i]=sc.nextInt() ary[i] ary i sc.nextInt() sc.nextInt sc for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		} {
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		} for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			} int j=i; int j=i; j i j>0 j 0 --j --j j {
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			} {
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			} a= Math.min(ary[j],ary[j-1]) a Math.min(ary[j],ary[j-1]) Math.min Math ary[j] ary j ary[j-1] ary j-1 j 1 b= Math.max(ary[j], ary[j-1]) b Math.max(ary[j], ary[j-1]) Math.max Math ary[j] ary j ary[j-1] ary j-1 j 1 ary[j-1]=a ary[j-1] ary j-1 j 1 a ary[j]=b ary[j] ary j b for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			} int k=0; int k=0; k 0 k<n k n ++k ++k k {
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			} {
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			} if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]); k!=n-1 k n-1 n 1 System.out.print(ary[k]+" ") System.out.print System.out System System.out ary[k]+" " ary[k] ary k " " System.out.print(ary[k]) System.out.print System.out System System.out ary[k] ary k System.out.println() System.out.println System.out System System.out String args[] args public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int ary[]= new int[n];
		int a,b;
		for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		}

		for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		}
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int ary[]= new int[n];
		int a,b;
		for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		}

		for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		}
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int ary[]= new int[n];
		int a,b;
		for (int i=0;i<n;++i){
			ary[i]=sc.nextInt();
		}

		for (int i=0;i<n;++i){
			for (int j=i;j>0;--j){
				a= Math.min(ary[j],ary[j-1]);
				b= Math.max(ary[j], ary[j-1]);
				ary[j-1]=a;
				ary[j]=b;
			}
			for (int k=0;k<n;++k){
				if (k!=n-1)System.out.print(ary[k]+" ");
				else System.out.print(ary[k]);
			}
			System.out.println();
		}
	}
}

