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

public class Main {

    static int n;
    static int[] data;
    static BufferedReader br;
    static BufferedWriter bw;

    public static void main(String args[]) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        String[] st = br.readLine().split(" ");
        data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        }

        for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        }
        printData();
        bw.flush();
    }

    static void printData() throws IOException {
        bw.append("" + data[0]);
        for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        }
        bw.newLine();
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.BufferedWriter; BufferedWriter java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.IOException; IOException java.io public class Main {

    static int n;
    static int[] data;
    static BufferedReader br;
    static BufferedWriter bw;

    public static void main(String args[]) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        String[] st = br.readLine().split(" ");
        data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        }

        for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        }
        printData();
        bw.flush();
    }

    static void printData() throws IOException {
        bw.append("" + data[0]);
        for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        }
        bw.newLine();
    }

} Main static int n; n static int[] data; data static BufferedReader br; br static BufferedWriter bw; bw public static void main(String args[]) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        String[] st = br.readLine().split(" ");
        data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        }

        for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        }
        printData();
        bw.flush();
    } main {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        String[] st = br.readLine().split(" ");
        data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        }

        for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        }
        printData();
        bw.flush();
    } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) bw = new BufferedWriter(new OutputStreamWriter(System.out)) bw new BufferedWriter(new OutputStreamWriter(System.out)) n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] st = br.readLine().split(" "); st br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " data = new int[n] data new int[n] n for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            data[i] = Integer.parseInt(st[i]);
        } {
            data[i] = Integer.parseInt(st[i]);
        } data[i] = Integer.parseInt(st[i]) data[i] data i Integer.parseInt(st[i]) Integer.parseInt Integer st[i] st i for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        } {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        } printData() printData int key = data[i]; key data[i] data i int j = i - 1; j i - 1 i 1 while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            } j >= 0 && data[j] > key j >= 0 j 0 data[j] > key data[j] data j key {
                data[j + 1] = data[j];
                j--;
            } data[j + 1] = data[j] data[j + 1] data j + 1 j 1 data[j] data j j-- j data[j + 1] = key data[j + 1] data j + 1 j 1 key printData() printData bw.flush() bw.flush bw String args[] args static void printData() throws IOException {
        bw.append("" + data[0]);
        for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        }
        bw.newLine();
    } printData {
        bw.append("" + data[0]);
        for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        }
        bw.newLine();
    } bw.append("" + data[0]) bw.append bw "" + data[0] "" data[0] data 0 for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        } int j = 1; int j = 1; j 1 j < n j n j++ j++ j {
            bw.append(" " + data[j]);
        } {
            bw.append(" " + data[j]);
        } bw.append(" " + data[j]) bw.append bw " " + data[j] " " data[j] data j bw.newLine() bw.newLine bw public class Main {

    static int n;
    static int[] data;
    static BufferedReader br;
    static BufferedWriter bw;

    public static void main(String args[]) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        String[] st = br.readLine().split(" ");
        data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        }

        for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        }
        printData();
        bw.flush();
    }

    static void printData() throws IOException {
        bw.append("" + data[0]);
        for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        }
        bw.newLine();
    }

} public class Main {

    static int n;
    static int[] data;
    static BufferedReader br;
    static BufferedWriter bw;

    public static void main(String args[]) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        String[] st = br.readLine().split(" ");
        data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        }

        for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        }
        printData();
        bw.flush();
    }

    static void printData() throws IOException {
        bw.append("" + data[0]);
        for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        }
        bw.newLine();
    }

} Main

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

public class Main {

    static int n;
    static int[] data;
    static BufferedReader br;
    static BufferedWriter bw;

    public static void main(String args[]) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        String[] st = br.readLine().split(" ");
        data = new int[n];
        for (int i = 0; i < n; i++) {
            data[i] = Integer.parseInt(st[i]);
        }

        for (int i = 1; i < n; i++) {
            printData();
            int key = data[i];
            int j = i - 1;
            while (j >= 0 && data[j] > key) {
                data[j + 1] = data[j];
                j--;
            }
            data[j + 1] = key;
        }
        printData();
        bw.flush();
    }

    static void printData() throws IOException {
        bw.append("" + data[0]);
        for (int j = 1; j < n; j++) {
            bw.append(" " + data[j]);
        }
        bw.newLine();
    }

}
