eolymp
bolt
Try our new interface for solving problems
Problems

Three sequences

Three sequences

Three sequences of integers are given. Find the length of their longest common subsequence. \InputFile Contains the description of three sequences. Each sequence in given with two lines. First line contains the length of the sequence $n~(1 \le n \le 100)$, and second line contains its elements ($32$ bits integers). \OutputFile Print the length of the longest common subsequence.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
1 2 3
3
1 3 2
3
2 1 3
Output example #1
2
Input example #2
3
1 2 3
3
4 5 6
3
1 3 5
Output example #2
0