Problems
LCS-2
LCS-2
Two strings are given. Find their longest common subsequence.
Input
Two strings consisting of small Latin letters. The length of each string is no more than 1000.
Output
Print the longest common subsequence of two strings.
Input example #1
abacaba dacabc
Output example #1
acab
Input example #2
sislksh lkshsis
Output example #2
lksh