#P4681. String

String

Problem Description

Given 3 strings A, B, C, find the longest string D which satisfy the following rules:
a) D is the subsequence of A
b) D is the subsequence of B
c) C is the substring of D
Substring here means a consecutive subsequnce.
You need to output the length of D.

Input

The first line of the input contains an integer T(T = 20) which means the number of test cases.
For each test case, the first line only contains string A, the second line only contains string B, and the third only contains string C.
The length of each string will not exceed 1000, and string C should always be the subsequence of string A and string B.
All the letters in each string are in lowercase.

Output

For each test case, output Case #a: b. Here a means the number of case, and b means the length of D.

2 aaaaa aaaa aa abcdef acebdf cf
Case #1: 4 Case #2: 3

Hint


For test one, D is "aaaa", and for test two, D is "acf".