import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
 
public class Main {
 
    public static void main(String[] args) throws Exception {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {
 
    public static void main(String[] args) throws Exception {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    }
} Main public static void main(String[] args) throws Exception {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    } main {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuffer sb = new StringBuffer(); sb new StringBuffer() int count = Integer.parseInt(br.readLine()); count Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        } int i = 1; int i = 1; i 1 i < count i count i++ i++ i {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        } {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        } System.out.println(String.join(" ",str)) System.out.println System.out System System.out String.join(" ",str) String.join String " " str for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            } int j = i - 1; int j = i - 1; j i - 1 i 1 j >= 0 j 0 j-- j-- j {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            } {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            } if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                } Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1]) Integer.parseInt(str[j]) Integer.parseInt Integer str[j] str j Integer.parseInt(str[j + 1]) Integer.parseInt Integer str[j + 1] str j + 1 j 1 {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                } String tmpNum = str[j]; tmpNum str[j] str j str[j] = str[j + 1] str[j] str j str[j + 1] str j + 1 j 1 str[j + 1] = tmpNum str[j + 1] str j + 1 j 1 tmpNum System.out.println(String.join(" ",str)) System.out.println System.out System System.out String.join(" ",str) String.join String " " str String[] args args public class Main {
 
    public static void main(String[] args) throws Exception {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    }
} public class Main {
 
    public static void main(String[] args) throws Exception {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
 
public class Main {
 
    public static void main(String[] args) throws Exception {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    }
}