import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }
        int changeBox = 0;

        for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        }
        for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }
        int changeBox = 0;

        for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        }
        for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        }
    }
} Main public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }
        int changeBox = 0;

        for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        }
        for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }
        int changeBox = 0;

        for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        }
        for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] A = new int[n]; A new int[n] n for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            A[i] = Integer.parseInt(input[i]);
        } {
            A[i] = Integer.parseInt(input[i]);
        } A[i] = Integer.parseInt(input[i]) A[i] A i Integer.parseInt(input[i]) Integer.parseInt Integer input[i] input i int changeBox = 0; changeBox 0 for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        } {
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        } if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            } i == n - 1 i n - 1 n 1 {
                System.out.println(A[i]);
            } System.out.println(A[i]) System.out.println System.out System System.out A[i] 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 " " for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        } {
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        } changeBox = (A[i]) changeBox (A[i]) A i int j = i - 1; j i - 1 i 1 while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            } j >= 0 && changeBox < (A[j]) j >= 0 j 0 changeBox < (A[j]) changeBox (A[j]) A j {
                A[j + 1] = A[j];
                j--;
            } A[j + 1] = A[j] A[j + 1] A j + 1 j 1 A[j] A j j-- j A[j + 1] = changeBox A[j + 1] A j + 1 j 1 changeBox for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            } int k = 0; int k = 0; k 0 k < n k n k++ k++ k {
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            } {
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            } if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                } k == n - 1 k n - 1 n 1 {
                    System.out.println(A[k]);
                } System.out.println(A[k]) System.out.println System.out System System.out A[k] A k {
                    System.out.print(A[k] + " ");
                } System.out.print(A[k] + " ") System.out.print System.out System System.out A[k] + " " A[k] A k " " String[] args args public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }
        int changeBox = 0;

        for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        }
        for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        }
    }
} public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }
        int changeBox = 0;

        for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        }
        for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }
        int changeBox = 0;

        for(int i = 0; i < n; i++){
            if(i == n - 1){
                System.out.println(A[i]);
            }else{
                System.out.print(A[i] + " ");
            }
        }
        for(int i = 1; i < n; i++){
            changeBox = (A[i]);
            int j = i - 1;
            while(j >= 0 && changeBox < (A[j])){
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = changeBox;
            for(int k = 0; k < n; k++){
                if(k == n - 1){
                    System.out.println(A[k]);
                }else{
                    System.out.print(A[k] + " ");
                }
            }
        }
    }
}