P27339 [AtCoder] Electric Bulletin Board
提高
题目描述

Problem Description

There is an electric bulletin board that displays a number sequence of $ N $ digits. This bulletin board is composed of lamps arranged in 5 rows and $ 4N+1 $ columns. For $ j $ satisfying $1 \leq j \leq N$, the display of the $ j $-th digit from the left uses the lamps in the columns $ 4j-2, 4j-1, 4j $ from the left. All other lamps in the columns $1, 5, \ldots, 4N+1$ are turned off.

The status of the display on the bulletin board is represented by 5 strings of length $ 4N+1 $, $ s_1, s_2, s_3, s_4, s_5 $. Specifically, for $ (i, j) $ satisfying $1 \leq i \leq 5$ and $1 \leq j \leq 4N+1$, the $ j $-th character from the beginning of $ s_i $ represents the lighting status of the lamp in the $ i $-th row and $ j $-th column from the left.

The character # in the strings indicates that the corresponding lamp is on, and . indicates that it is off.

Output the $ N $-digit number sequence displayed on the bulletin board.

Refer to Sample Input #1 for the display method of each digit.

Input Format

The input is given from the standard input in the following format:

$ N $ $ s_1 $ $ s_2 $ $ s_3 $ $ s_4 $ $ s_5 $

Output Format

Output the $ N $-digit number sequence displayed on the bulletin board.

Sample Input and Output

Sample Input #1

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

Sample Output #1

0123456789

Sample Input #2

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

Sample Output #2

20790697846444679018792642532

Notes/Hints

Note

Discussion of this problem is prohibited until 18:00 JST on June 6, 2020. If mentioned, it may result in a claim for damages. It is okay to publish the total score and certification level after the exam, but please refrain from disseminating information about which problems were solved.

Constraints

  • $1 \leq N \leq 50$
  • $ s_1, s_2, s_3, s_4, s_5 $ are strings of length $ 4N+1 $ consisting only of # and .
  • The $1, 5, \ldots, 4N+1$ characters of $ s_1, s_2, s_3, s_4, s_5 $ are all .
  • There always exists a corresponding number sequence for the input, and the display method of each digit is the same as in Sample Input #1
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
10 .###..#..###.###.#.#.###.###.###.###.###. .#.#.##....#...#.#.#.#...#.....#.#.#.#.#. .#.#..#..###.###.###.###.###...#.###.###. .#.#..#..#.....#...#...#.#.#...#.#.#...#. .###.###.###.###...#.###.###...#.###.###.
样例输出
0123456789