For example, the phrase
to be or not to bematches the pattern
<foo> be <bar> not <foo> <baf>because we can replace <foo> by to, <bar> by or, and <baf> by be.
Given two patterns, you are to find a phrase that matches both.
The first line of input contains n, the number of test cases. Each test case consists of two lines of input; each a pattern. Patterns consist of lowercase words, and placeholders containing lowercase words. No pattern exceeds 100 characters. Words contain at most 16 characters. A single space separates adjacent words and placeholders.
For each test case, output a phrase that matches both patterns. If several phrases match, any will do. If no phrase matches, output a line containing "-" (a single minus sign).
3 how now brown <animal> <foo> now <color> cow who are you <a> <b> <a> <a> b c <a>
how now brown cow - c b