Wildcard (Small)

Given two lowercase names, output the shortest wildcard pattern of letters and stars that matches the first name but not the second.

Medium6String matchingBrute forceBFSNo attempts yetTime limit5sMemory limit512 MB

Problem

Many operating systems let you use an asterisk * as a wildcard when you name a file. The asterisk matches any string, including the empty string.

Wildcards are often used to name several files at once, but they also make naming a single file easier. Say you want to name the file pascalisamazing. If no other file matches pascal*, that pattern alone names pascalisamazing. pascal* is much shorter than pascalisamazing, so it takes less typing.

Given two file names, find the shortest pattern that matches only one of them.

Input

The first line has the number of test cases TT. The TT test cases follow, two lines each. The first line of a test case has the first file name AA, the second line has the second file name BB. File names consist of lowercase letters only.

Constraints

  • 1T1001 \le T \le 100
  • AA and BB are different strings
  • AA and BB are each at least 1 and at most 12 characters long

Output

For each test case print one line in this format.

Case #X: Y

XX is the number of the test case and YY is the shortest pattern that matches AA but does not match BB. A pattern consists of lowercase letters and asterisks. If several shortest patterns exist, print the one with the fewest asterisks. If several still remain, print the first one in lexicographic order. Characters compare by their ASCII codes, and the asterisk is smaller than every lowercase letter.