Library method#2664

Library method

1 second
64 megabytes
Very easy

Demonstrate how the insertion sort algorithm works to sort an array in ascending order. For this task, print the state of the array after each insertion step on a new line. If the array is already initially sorted, do not print anything.

Input

The first line contains the integer (1 \leq N \leq 100), the number of elements in the array. The second line contains the array itself: a sequence of natural numbers, each not exceeding 10^9.

Output

Print the state of the array after each insertion step, with each line containing numbers.

Examples

Example 1

Loading
Loading