Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8825

Jo'natishlar soni: 714634

Muhokama yozuvlari: 4541

Yangiliklar soni: 98

Yangiliklar izohlari: 1179


So'ngi izohlar

785. Tetris Alphabet
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

The game of Tetris is played with four-connected blocks falling down the well having N rows and 20 columns. Each figure is marked with a unique English letter from A to Z.

Your program must, given the state of the well, determine the order in which the blocks fell down.

Input

The first line of input file contains integer N (1 £ N £ 50) number of rows. Following N lines contain 20 characters each, with characters that are either a letter from A to Z or the dot character (ASCII 46), representing an empty cell.

Output

Output file must contain a string of letters indicating the order in which figures fell down. If there is more than one order, lexicographically smallest one must be printed. Input data will guarantee that at least one nonempty order exists.

Samples

Input

Output

1

6

...........XX.......

..........MMMM......

..........K.........

........KKK.........

.....ZAAA.FFF.......

.....ZZZA..F.B......

BFZAKMX

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(12) Barcha urinishlar(34)