A Path P is defined as P:=label|P/label|P//label.
A label is any string with visible characters except '/', e.g. "person", "name", "job", ... are labels.
label1//label2 means there are n(n>=0) labels between label1 and label2, which can be any strings.
label1/label2 means there is no label between label1 and label2.
That is to say, P is composed of a(a>=1) labels and b(b>=0) "//"s or "/"s, representing all ordered label sets that meet P.

For example, P is person//name/job//sex/hobby. An ordered label set
        person name job a sex hobby
is in P, and
        person haha momo name job a b c sex hobby
is also in P.
        person name sex job hobby
is not in P.

P1,P2 are Paths.
If all the ordered label sets meet P2 can be described with P1, we say P1 includes P2.
You are to write a program to judge whether P1 includes P2.

Input:
There are multiple test cases.
The first line is an integer n: the number of test cases(n<100), followed by n group test data.
each group data contains 2 Path: P1 and P2, divided by a new line symbol.
the length of P1 and P2 is equal to or less than 1024 characters.

Output:
Output "Y" in a single line if P1 includes P2, otherwise output "N".

Sample Input:

3
person//name/job//sex/hobby
person/haha/name/job//sex/hobby
person//name/job//sex/hobby
person//name//job/sex/hobby
HIT//SJTU//TSU//PKU
HIT/SJTU//PKU

Sample Output:

Y
N
N