
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n;
    static int a[];

    public static void main(String[] args) {
        read();
        output();
        solve();
    }

    public static void read() {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    }

    public static void solve() {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    }
    public static void output(){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n;
    static int a[];

    public static void main(String[] args) {
        read();
        output();
        solve();
    }

    public static void read() {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    }

    public static void solve() {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    }
    public static void output(){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static int n; n static int a[]; a public static void main(String[] args) {
        read();
        output();
        solve();
    } main {
        read();
        output();
        solve();
    } read() read output() output solve() solve String[] args args public static void read() {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    } read {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    } n = sc.nextInt() n sc.nextInt() sc.nextInt sc a = new int[n] a new int[n] n for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc public static void solve() {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    } solve {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    } for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        } int i=1; int i=1; i 1 i<n i n i++ i++ i {
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        } {
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        } int v = i; v i while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            } v>0 v 0 {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            } if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                } a[v - 1] > a[v] a[v - 1] a v - 1 v 1 a[v] a v {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                } int tmp = a[v]; tmp a[v] a v a[v] = a[v - 1] a[v] a v a[v - 1] a v - 1 v 1 a[v - 1] = tmp a[v - 1] a v - 1 v 1 tmp v-- v output() output public static void output(){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    } output {
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    } for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        } int i = 0; int i = 0; i 0 i<a.length i a.length a a.length i++ i++ i {
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        } {
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        } System.out.print(a[i]) System.out.print System.out System System.out a[i] a i if(i+1<a.length){
                System.out.print(" ");
            } i+1<a.length i+1 i 1 a.length a a.length {
                System.out.print(" ");
            } System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n;
    static int a[];

    public static void main(String[] args) {
        read();
        output();
        solve();
    }

    public static void read() {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    }

    public static void solve() {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    }
    public static void output(){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    }
} public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n;
    static int a[];

    public static void main(String[] args) {
        read();
        output();
        solve();
    }

    public static void read() {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    }

    public static void solve() {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    }
    public static void output(){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    }
} Main

import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n;
    static int a[];

    public static void main(String[] args) {
        read();
        output();
        solve();
    }

    public static void read() {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    }

    public static void solve() {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    }
    public static void output(){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    }
}