atcoder#AGC052A. [AGC052A] Long Common Subsequence
[AGC052A] Long Common Subsequence
Score : points
Problem Statement
You are given binary strings , each containing exactly 0
's and 1
's.
Find a binary string of length , which is a subsequence of all of the strings ( denotes the concatenation of strings and in order). It's guaranteed that under the constraints above such a string always exists.
Here a string is a subsequence of a string if can be obtained by removing zero or more characters from and concatenating the remaining characters without changing the order.
You will be given test cases. Solve each of them.
Constraints
- is a binary string of length consisting of
0
's and1
's. - The sum of over all test cases doesn't exceed .
Input
Input is given from Standard Input in the following format. The first line of input is as follows:
Then, test cases follow, each of which is in the following format:
Output
For each test case, print any binary string of length , which is a subsequence of all of . If many such strings exist, you can print any.
2
1
01
01
10
2
0101
0011
1100
010
11011
In the first case, 010
is a subsequence of 0101
, 0101
, and 1010
.
In the second case, 11011
is a subsequence of 01010101
, 00110011
, and 11001100
.