#include <bits/stdc++.h>
int main() {
  int i, j, key, n, A[100], 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;
}
