Remove the Duplicates

Time limit1sMemory limit128 MB

Problem

Al's Chocolate Mango Company runs a website where visitors can guess how many chocolate mangoes are inside a 2d jar. A visitor picks a number from $1$ to $99$ and presses the "Submit" button. Because the server often responds slowly, impatient visitors mash the "Submit" button several times, which causes the same number to be submitted many times in a row.

Help the ACM staff collapse each run of consecutive duplicate submissions into a single value, recovering the original intended sequence.

Input

The input consists of several test cases. Each line begins with an integer $N$ ($0 < N \le 25$), followed by $N$ integers, each between $1$ and $99$ inclusive. These $N$ numbers are the submitted values, in the order the visitor pressed them.

The last line contains a single $0$, marking the end of the input.

Output

For each test case, print one line containing the submissions after collapsing every run of consecutive equal numbers into one, separated by single spaces. At the end of each line, print a single space followed by a $ character.