var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var input_array =input.trim().split("\n");
var numbers = input_array[1].split(' ').map((n) => Number(n));

var value;

for (var i = 0; i < numbers.length; i++) {
  value = numbers[i];
  j = i - 1;
  while (j >= 0 && numbers[j] > value) {
    numbers[j+1] = numbers[j];
    j--;
  }
  numbers[j+1] = value;
  console.log(numbers.join(' '));
}

