1332: 模拟插入排序

Memory Limit:256 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:35 Solved:15

Description

现给出长度为 $n$ 的序列 $a_1,a_2,...a_n$,请按顺序输出每一个元素 $a_i$ 向前插入过程中与其交换的元素。

Input

第一行,一个正整数 $n$。

第二行,包含 $n$ 个整数 $a_1,a_2,...a_n$,中间以空格隔开,表示整个序列。

Output

共 $n-1$ 行($a_1$ 不需要向前插入)。

第 $i$ 行包含若干个整数,表示 $a_{i+1}$ 向前插入过程中与其交换的元素。

倘若某元素无法向前插入,也占一行。

Sample Input Copy

5
4 1 3 4 2

Sample Output Copy

4
4

4 4 3

HINT

数据范围

$0< n \le 100$;

$-10^9 \le a_i \le 10^9$。

Source/Category