import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        }

        sc.close();
    }

    private static void println(int[] A) {
        int N = A.length;
        String[] sb = new String[N];
        for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        }
        System.out.println(String.join(" ", sb));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        }

        sc.close();
    }

    private static void println(int[] A) {
        int N = A.length;
        String[] sb = new String[N];
        for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        }
        System.out.println(String.join(" ", sb));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        }

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        }

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] 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 for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        } {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        } int v = A[i]; v A[i] A i int j = i - 1; j i - 1 i 1 while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            } j >= 0 && A[j] > v j >= 0 j 0 A[j] > v A[j] A j v {
                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] = v A[j + 1] A j + 1 j 1 v println(A) println A sc.close() sc.close sc String[] args args private static void println(int[] A) {
        int N = A.length;
        String[] sb = new String[N];
        for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        }
        System.out.println(String.join(" ", sb));
    } println {
        int N = A.length;
        String[] sb = new String[N];
        for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        }
        System.out.println(String.join(" ", sb));
    } int N = A.length; N A.length A A.length String[] sb = new String[N]; sb new String[N] N for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            sb[i] = String.valueOf(A[i]);
        } {
            sb[i] = String.valueOf(A[i]);
        } sb[i] = String.valueOf(A[i]) sb[i] sb i String.valueOf(A[i]) String.valueOf String A[i] A i System.out.println(String.join(" ", sb)) System.out.println System.out System System.out String.join(" ", sb) String.join String " " sb int[] A A public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        }

        sc.close();
    }

    private static void println(int[] A) {
        int N = A.length;
        String[] sb = new String[N];
        for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        }
        System.out.println(String.join(" ", sb));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        }

        sc.close();
    }

    private static void println(int[] A) {
        int N = A.length;
        String[] sb = new String[N];
        for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        }
        System.out.println(String.join(" ", sb));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            int v = A[i];
            int j = i - 1;
            while (j >= 0 && A[j] > v) {
                A[j + 1] = A[j];
                j--;
            }
            A[j + 1] = v;

            println(A);
        }

        sc.close();
    }

    private static void println(int[] A) {
        int N = A.length;
        String[] sb = new String[N];
        for (int i = 0; i < N; i++) {
            sb[i] = String.valueOf(A[i]);
        }
        System.out.println(String.join(" ", sb));
    }
}
