Limits 1s, 512 MB

It’s not easy to hang out with your friends during weekends when you have a full-time job and bills to pay, not to mention you both live in the two opposite sides of the town and have different weekend breaks. Our friends Tom and John are going through the same hurdle, as they decide to make a plan. But wait, there is a problem! The companies that Tom and John work at, have weekends at different dates. Can you help them find if they are available in the same weekend?

Input

Input starts with T ( 1 <= T <= 500), number of test cases to follow.
Each test case contains, one line. Every line contains four strings, the weekends that Tom and John have in their company. The first two strings are the weekends that Tom has while the third and the fourth string represents John’s weekend.

Output

For each query, print Possible if the friends can meet. If they can not meet, print Oh no!, such a shame.

Samples

InputOutput
5
Monday Thursday Monday Tuesday
Friday Sunday Tuesday Thursday
Thursday Friday Friday Saturday
Monday Sunday Saturday Saturday
Wednesday Thursday Monday Sunday
Possible
Oh no!, such a shame
Possible
Oh no!, such a shame
Oh no!, such a shame
InputOutput
5
Monday Wednesday Tuesday Sunday
Saturday Saturday Monday Sunday
Friday Sunday Friday Sunday
Monday Thursday Wednesday Saturday
Thursday Saturday Wednesday Wednesday
Oh no!, such a shame
Oh no!, such a shame
Possible
Oh no!, such a shame
Oh no!, such a shame

Submit

Login to submit.

Statistics

99% Solution Ratio
wahsinnige_FEarliest, Sep '19
RamprosadGFastest, 0.0s
wahsinnige_FLightest, 131 kB
Nusab19Shortest, 106B
Toph uses cookies. By continuing you agree to our Cookie Policy.