#! /usr/bin/env python
# -*- coding : utf-8 -*-
input()
seq = [int(x) for x in input().split()]
for i in range(0, len(seq)):
    key = seq[i]
    j = i - 1
    assert isinstance(i, int)
    while j >= 0 and seq[j] > key:
        seq[j + 1] = seq[j]
        j -= 1
    seq[j + 1] = key
    print(' '.join(map(str,seq))) input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x seq = [int(x) for x in input().split()] seq [int(x) for x in input().split()] for i in range(0, len(seq)):
    key = seq[i]
    j = i - 1
    assert isinstance(i, int)
    while j >= 0 and seq[j] > key:
        seq[j + 1] = seq[j]
        j -= 1
    seq[j + 1] = key
    print(' '.join(map(str,seq))) i range(0, len(seq)) range 0 len(seq) len seq key = seq[i] key seq[i] seq i j = i - 1 j i - 1 i 1 assert isinstance(i, int) isinstance(i, int) isinstance i int while j >= 0 and seq[j] > key:
        seq[j + 1] = seq[j]
        j -= 1
     j >= 0 and seq[j] > key j >= 0 j 0 seq[j] > key seq[j] seq j key seq[j + 1] = seq[j] seq[j + 1] seq j + 1 j 1 seq[j] seq j j -= 1 j 1 seq[j + 1] = key seq[j + 1] seq j + 1 j 1 key print(' '.join(map(str,seq))) print ' '.join(map(str,seq)) ' '.join ' ' join map(str,seq) map str seq j -= 1 1 j j = i - 1 i - 1 j seq = [int(x) for x in input().split()] [int(x) for x in input().split()] seq key = seq[i] seq[i] key
#! /usr/bin/env python
# -*- coding : utf-8 -*-
input()
seq = [int(x) for x in input().split()]
for i in range(0, len(seq)):
    key = seq[i]
    j = i - 1
    assert isinstance(i, int)
    while j >= 0 and seq[j] > key:
        seq[j + 1] = seq[j]
        j -= 1
    seq[j + 1] = key
    print(' '.join(map(str,seq)))