import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int n = in.nextInt();
	Integer[] a = new Integer[n];
	for (int i = 0; i < n; i++) {
	    a[i] = in.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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	}

    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int n = in.nextInt();
	Integer[] a = new Integer[n];
	for (int i = 0; i < n; i++) {
	    a[i] = in.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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	}

    }
} Main public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int n = in.nextInt();
	Integer[] a = new Integer[n];
	for (int i = 0; i < n; i++) {
	    a[i] = in.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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	}

    } main {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int n = in.nextInt();
	Integer[] a = new Integer[n];
	for (int i = 0; i < n; i++) {
	    a[i] = in.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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	}

    } Scanner in = new Scanner(System.in); in new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int n = in.nextInt(); n in.nextInt() in.nextInt in Integer[] a = new Integer[n]; a new Integer[n] n for (int i = 0; i < n; i++) {
	    a[i] = in.nextInt();
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
	    a[i] = in.nextInt();
	} {
	    a[i] = in.nextInt();
	} a[i] = in.nextInt() a[i] a i in.nextInt() in.nextInt in 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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	} 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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	} {
	    int v = a[i];
	    int j = i - 1;
	    while (j >= 0 && a[j] > v) {
		a[j + 1] = a[j];
		j--;
	    }
	    a[j + 1] = v;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	} 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 sb.setLength(0) sb.setLength sb 0 for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    } int k = 0; int k = 0; k 0 k < n k n k++ k++ k {
		sb.append(a[k]);
		sb.append(" ");
	    } {
		sb.append(a[k]);
		sb.append(" ");
	    } sb.append(a[k]) sb.append sb a[k] a k sb.append(" ") sb.append sb " " System.out.println(sb.toString().trim()) System.out.println System.out System System.out sb.toString().trim() sb.toString().trim sb.toString() sb.toString sb String[] args args public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int n = in.nextInt();
	Integer[] a = new Integer[n];
	for (int i = 0; i < n; i++) {
	    a[i] = in.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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	}

    }
} public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int n = in.nextInt();
	Integer[] a = new Integer[n];
	for (int i = 0; i < n; i++) {
	    a[i] = in.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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	}

    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	StringBuilder sb = new StringBuilder();
	int n = in.nextInt();
	Integer[] a = new Integer[n];
	for (int i = 0; i < n; i++) {
	    a[i] = in.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;
	    sb.setLength(0);
	    for (int k = 0; k < n; k++) {
		sb.append(a[k]);
		sb.append(" ");
	    }
	    System.out.println(sb.toString().trim());
	}

    }
}

