Contest Duration: - (local time) (300 minutes) Back to Home
D - Digital Display /

Time Limit: 2 sec / Memory Limit: 1024 MB

### 注意

この問題に対する言及は、2020/6/6 18:00 JST まで禁止されています。言及がなされた場合、賠償が請求される可能性があります。 試験後に総合得点や認定級を公表するのは構いませんが、どの問題が解けたかなどの情報は発信しないようにお願いします。

### 問題文

N 桁の数字列を表示する電光掲示板があります。 この電光掲示板は 54N+1 列に並べられたランプにより構成されます。 1 \leq j \leq N を満たす j について、左から j 桁目の数字の表示には左から 4j-2,4j-1,4j 列目のランプが用いられます。 それ以外の 1,5, \ldots, 4N+1 列目のランプは全て消灯しています。

### 制約

• 1 \leq N \leq 50
• s_1,s_2,s_3,s_4,s_5#. のみからなる長さ 4N+1 の文字列
• s_1,s_2,s_3,s_4,s_51,5, \ldots, 4N+1 文字目は全て .
• 入力に対応する数字列が必ず存在し、各数字の表示の仕方は入力例 1 のものと同様

### 入力

N
s_1
s_2
s_3
s_4
s_5


### 入力例 1

10
.###..#..###.###.#.#.###.###.###.###.###.
.#.#.##....#...#.#.#.#...#.....#.#.#.#.#.
.#.#..#..###.###.###.###.###...#.###.###.
.#.#..#..#.....#...#...#.#.#...#.#.#...#.
.###.###.###.###...#.###.###...#.###.###.


### 出力例 1

0123456789


### 入力例 2

29
.###.###.###.###.###.###.###.###.###.#.#.###.#.#.#.#.#.#.###.###.###.###..#..###.###.###.###.###.#.#.###.###.###.###.
...#.#.#...#.#.#.#.#.#...#.#...#.#.#.#.#.#...#.#.#.#.#.#.#.....#.#.#.#.#.##..#.#...#.#.#...#.#...#.#...#.#.....#...#.
.###.#.#...#.###.#.#.###.###...#.###.###.###.###.###.###.###...#.###.#.#..#..###...#.###.###.###.###.###.###.###.###.
.#...#.#...#...#.#.#.#.#...#...#.#.#...#.#.#...#...#...#.#.#...#...#.#.#..#..#.#...#...#.#...#.#...#.#.....#...#.#...
.###.###...#.###.###.###.###...#.###...#.###...#...#...#.###...#.###.###.###.###...#.###.###.###...#.###.###.###.###.


### 出力例 2

20790697846444679018792642532


Score : 7 points

### Warning

Do not make any mention of this problem until June 6, 2020, 6:00 p.m. JST. In case of violation, compensation may be demanded. After the examination, you can reveal your total score and grade to others, but nothing more (for example, which problems you solved).

### Problem Statement

We have an electric bulletin board that shows an N-digit number. The board is made of a grid of lamps with 5 rows and 4N+1 columns. For each j such that 1 \leq j \leq N, the j-th digit from the left is displayed using the lamps in the (4j-2)-th, (4j-1)-th, and (4j)-th columns from the left. All the remaining lamps in the 1-st, 5-th, \ldots, (4N+1)-th columns are off.

The state of the board is represented by five strings of length 4N+1 each: s_1, s_2, s_3, s_4, and s_5. More specifically, for each pair (i,j) such that 1 \leq i \leq 5 and 1 \leq j \leq 4N+1, the j-th character of s_{i} repsesents the state of the lamp at the i-th row from the top and the j-th column from the left.

The characters # and . stand for "on" and "off" states, respectively.

Print the sequence of digits displayed on the board.

To see how the board displays each digit, refer to Sample Input 1.

### Constraints

• 1 \leq N \leq 50
• s_1, s_2, s_3, s_4, and s_5 are strings of length 4N+1 each and consist of # and ..
• The 1-st, 5-th, \ldots, (4N+1)-th characters of each of the strings s_1, s_2, s_3, s_4, and s_5 are all .s.
• The input is a valid representation of a sequence of digits in the same way as in Sample Input 1.

### Input

Input is given from Standard Input in the following format:

N
s_1
s_2
s_3
s_4
s_5


### Output

Print the N-digit sequence displayed on the board.

### Sample Input 1

10
.###..#..###.###.#.#.###.###.###.###.###.
.#.#.##....#...#.#.#.#...#.....#.#.#.#.#.
.#.#..#..###.###.###.###.###...#.###.###.
.#.#..#..#.....#...#...#.#.#...#.#.#...#.
.###.###.###.###...#.###.###...#.###.###.


### Sample Output 1

0123456789


### Sample Input 2

29
.###.###.###.###.###.###.###.###.###.#.#.###.#.#.#.#.#.#.###.###.###.###..#..###.###.###.###.###.#.#.###.###.###.###.
...#.#.#...#.#.#.#.#.#...#.#...#.#.#.#.#.#...#.#.#.#.#.#.#.....#.#.#.#.#.##..#.#...#.#.#...#.#...#.#...#.#.....#...#.
.###.#.#...#.###.#.#.###.###...#.###.###.###.###.###.###.###...#.###.#.#..#..###...#.###.###.###.###.###.###.###.###.
.#...#.#...#...#.#.#.#.#...#...#.#.#...#.#.#...#...#...#.#.#...#...#.#.#..#..#.#...#...#.#...#.#...#.#.....#...#.#...
.###.###...#.###.###.###.###...#.###...#.###...#...#...#.###...#.###.###.###.###...#.###.###.###...#.###.###.###.###.


### Sample Output 2

20790697846444679018792642532