import java.util.Scanner;

/**
 * Sort
 */
public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void go() {
        for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        }
        this.print();
    }

    public void print() {
        for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    }

    public static void main(String[] args) {
        Main sort = new Main();
        sort.scan();
        sort.go();
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void go() {
        for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        }
        this.print();
    }

    public void print() {
        for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    }

    public static void main(String[] args) {
        Main sort = new Main();
        sort.scan();
        sort.go();
    }
} Main public int size; size public int[] mx; mx public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    } scan {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) this.size = sc.nextInt() this.size this this.size sc.nextInt() sc.nextInt sc this.mx = new int[this.size] this.mx this this.mx new int[this.size] this.size this this.size for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < this.size i this.size this this.size i++ i++ i {
            this.mx[i] = sc.nextInt();
        } {
            this.mx[i] = sc.nextInt();
        } this.mx[i] = sc.nextInt() this.mx[i] this.mx this this.mx i sc.nextInt() sc.nextInt sc public void go() {
        for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        }
        this.print();
    } go {
        for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        }
        this.print();
    } for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        } int i = 1; int i = 1; i 1 i < this.size i this.size this this.size i++ i++ i {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        } {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        } this.print() this.print this int v = this.mx[i]; v this.mx[i] this.mx this this.mx i int j = i - 1; j i - 1 i 1 while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            } j >= 0 && this.mx[j] > v j >= 0 j 0 this.mx[j] > v this.mx[j] this.mx this this.mx j v {
                this.mx[j + 1] = this.mx[j];
                j--;
            } this.mx[j + 1] = this.mx[j] this.mx[j + 1] this.mx this this.mx j + 1 j 1 this.mx[j] this.mx this this.mx j j-- j this.mx[j + 1] = v this.mx[j + 1] this.mx this this.mx j + 1 j 1 v this.print() this.print this public void print() {
        for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    } print {
        for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    } for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        } int i = 0; int i = 0; i 0 i < this.size i this.size this this.size i++ i++ i {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        } {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        } System.out.print(this.mx[i]) System.out.print System.out System System.out this.mx[i] this.mx this this.mx i if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            } i == this.size - 1 i this.size - 1 this.size this this.size 1 {
                System.out.println();
            } System.out.println() System.out.println System.out System System.out {
                System.out.print(" ");
            } System.out.print(" ") System.out.print System.out System System.out " " public static void main(String[] args) {
        Main sort = new Main();
        sort.scan();
        sort.go();
    } main {
        Main sort = new Main();
        sort.scan();
        sort.go();
    } Main sort = new Main(); sort new Main() sort.scan() sort.scan sort sort.go() sort.go sort String[] args args public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void go() {
        for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        }
        this.print();
    }

    public void print() {
        for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    }

    public static void main(String[] args) {
        Main sort = new Main();
        sort.scan();
        sort.go();
    }
} public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void go() {
        for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        }
        this.print();
    }

    public void print() {
        for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    }

    public static void main(String[] args) {
        Main sort = new Main();
        sort.scan();
        sort.go();
    }
} Main
import java.util.Scanner;

/**
 * Sort
 */
public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void go() {
        for (int i = 1; i < this.size; i++) {
            this.print();
            int v = this.mx[i];
            int j = i - 1;
            while (j >= 0 && this.mx[j] > v) {
                this.mx[j + 1] = this.mx[j];
                j--;
            }
            this.mx[j + 1] = v;
        }
        this.print();
    }

    public void print() {
        for (int i = 0; i < this.size; i++) {
            System.out.print(this.mx[i]);
            if (i == this.size - 1) {
                System.out.println();
            } else {
                System.out.print(" ");
            }
        }
    }

    public static void main(String[] args) {
        Main sort = new Main();
        sort.scan();
        sort.go();
    }
}
