import java.io.*;

class Main{
    

    public static void main(String[] args){
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line1 = reader.readLine();
                    int x = Integer.parseInt(line1);
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[x];
			
			for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            }
            
            for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            }

            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    }
} import java.io.*; io.* java class Main{
    

    public static void main(String[] args){
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line1 = reader.readLine();
                    int x = Integer.parseInt(line1);
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[x];
			
			for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            }
            
            for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            }

            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    }
} Main public static void main(String[] args){
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line1 = reader.readLine();
                    int x = Integer.parseInt(line1);
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[x];
			
			for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            }
            
            for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            }

            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line1 = reader.readLine();
                    int x = Integer.parseInt(line1);
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[x];
			
			for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            }
            
            for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            }

            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) try {       
                    String line1 = reader.readLine();
                    int x = Integer.parseInt(line1);
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[x];
			
			for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            }
            
            for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            }

            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        } IOException e {
            //TODO: handle exception
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {       
                    String line1 = reader.readLine();
                    int x = Integer.parseInt(line1);
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[x];
			
			for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            }
            
            for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            }

            
                            
        } String line1 = reader.readLine(); line1 reader.readLine() reader.readLine reader int x = Integer.parseInt(line1); x Integer.parseInt(line1) Integer.parseInt Integer line1 String line = reader.readLine(); line reader.readLine() reader.readLine reader String[] strAry = line.split(" "); strAry line.split(" ") line.split line " " int[] a = new int[x]; a new int[x] x for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            } int i = 0; int i = 0; i 0 i < strAry.length i strAry.length strAry strAry.length i++ i++ i {
				a[i] = Integer.parseInt(strAry[i]);
            } {
				a[i] = Integer.parseInt(strAry[i]);
            } a[i] = Integer.parseInt(strAry[i]) a[i] a i Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry i for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            } int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            } {
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            } for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                } int k = 0; int k = 0; k 0 k < i k i k++ k++ k {
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                } {
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                } if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } a[i] < a[k] a[i] a i a[k] a k {
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } int kara = a[i]; kara a[i] a i for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        } int j = 0; int j = 0; j 0 j < (i - k) j (i - k) i k j++ j++ j {
                            a[i - j] = a[i - j - 1];
                        } {
                            a[i - j] = a[i - j - 1];
                        } a[i - j] = a[i - j - 1] a[i - j] a i - j i j a[i - j - 1] a i - j - 1 i - j - 1 i j 1 a[k] = kara a[k] a k kara System.out.print(a[0]) System.out.print System.out System System.out a[0] a 0 for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                } int l = 1; int l = 1; l 1 l < x l x l++ l++ l {
                    System.out.print(" " + a[l]);
                } {
                    System.out.print(" " + a[l]);
                } System.out.print(" " + a[l]) System.out.print System.out System System.out " " + a[l] " " a[l] a l System.out.println() System.out.println System.out System System.out String[] args args
import java.io.*;

class Main{
    

    public static void main(String[] args){
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line1 = reader.readLine();
                    int x = Integer.parseInt(line1);
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[x];
			
			for (int i = 0;i < strAry.length; i++){
				a[i] = Integer.parseInt(strAry[i]);
            }
            
            for(int i = 0; i < x; i++){
                for(int k = 0; k < i; k++){
                    if(a[i] < a[k]){
                        int kara = a[i];
                        for(int j = 0; j < (i - k); j++){
                            a[i - j] = a[i - j - 1];
                        }
                        a[k] = kara;
                    } 
                }
                System.out.print(a[0]);
                for(int l = 1; l < x; l++){
                    System.out.print(" " + a[l]);
                }
                System.out.println();
            }

            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    }
}