You are developing a program for comparing text data and you need to find the greatest general subsequence between two lines. Style = "Text-align: Justify;"> Two lines are given. Find the greatest general subsequence (LCS, Longest Common Subsequence).
Input format
two lines, the tips of each of which are separated by spaces (if the element is one, then compare inside it)
Output format
The longest general subsequence
Example
Input
Music movie Traveling Book Sports
Cinema Dancing Books Culinary
Hint
There will be no clue here, decide for yourself!