#include<stdio.h>

void trace(int a[], int n){
    int i;
    for(i=0; i<n; i++){
      if(i>0)        printf(" ");
      
        printf("%d", a[i]);
    }
    printf("\n");
}

void insertionSort(int a[], int n){
  int i, j, s;

  for(i=1; i<n; i++){
        s = a[i];
        j = i-1;
        while(j >= 0 && a[j] > s){
            a[j+1] = a[j];
            j--;
        }

	a[j+1] = s;
        trace(a, n);
    }
}

int main(){
  int  i, j, n;
    int a[100];

    scanf("%d", &n);
    for (i=0; i<n; i++)     scanf("%d", &a[i]);

    trace(a, n);
    insertionSort(a, n);

    return 0;
}

