#include<stdio.h>
#define N 100
int main(){
  int i,j,key,n,A[N],count;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  for(i=0;i<n;i++){
    for(j=n;j>0;j--){
      if(A[j]<A[j-1]){
	key=A[j];
	A[j]=A[j-1];
	A[j-1]=key;
      }  
      printf("%d ",A[j]);
    }
    printf("\n");
  }
      return 0;
    
  }