Statement
Statement language
You are given a sequence of length and a sequence of length .
Print any longest common subsequence of and . A subsequence is obtained by deleting zero or more elements from a sequence while preserving the order of the remaining elements.
Input
The input is given in the following format:
Each case is given in the following format:
Output
For each case, print the length of a longest common subsequence on one line. If , print its elements separated by spaces on the next line. If , print no elements.
If several longest common subsequences exist, you may print any of them.
Constraints
- .
- .
- ().
- ().
- The sum of over all cases is at most .
- The sum of over all cases is at most .
Subtasks
Samples
Input
3
3 3
1 2 3
2 1 3
2 2
1 1
2 2
4 3
5 1 5 2
1 5 2
Output
2
1 3
0
3
1 5 2