Byephone

No attempts yetTime limit2sMemory limit3 MB

Problem

Byteman is porting his favorite text editor to a new phone called Byephone (a name coined from the words byte and phone).

One feature of this editor compares two documents line by line. The comparison is based on an algorithm that computes the Longest Common Subsequence (LCS) of two strings.

Byteman soon realizes that the phone does not have nearly enough memory to run the algorithm he uses, so he asks for your help.

Using only 3MB of memory, write a program that finds the longest common subsequence of the two given strings.

Input

The first line contains two integers n1n_1 and n2n_2 (1n1,n2100001 \le n_1, n_2 \le 10\,000), the lengths of the two strings.

The second and third lines contain the two strings, of lengths n1n_1 and n2n_2 respectively. Both strings consist only of lowercase English letters.

Output

Print two lines.

On the first line, print the length KK of the longest common subsequence of the two strings.

On the second line, print a longest common subsequence of length KK. If there are several longest common subsequences of length KK, print the lexicographically smallest one.

If there is no common subsequence, print 00 on the first line and leave the second line empty.