During a programming contest, Mr. Shocking Tale (a.k.a. MST) was accused of stealing code. To prove his innocence, he shouted: "My algorithm is original! It's literally called M... S... T...!"
The judges, however, noticed that every time he wrote "MST", the three-word expansion changed randomly. Was this a clever trick or just chaos?
One judge even snorted: "Yesterday it was Mangoes Squeeze Time, today it's Mice Sing Telepathically... Next, you'll say it's Minimum Spanning Tree!"
Whatever, to prove his correctness, given three words, determine if their initials form MST (i.e., each word starts with M, S, T in order).
There are multiple test cases. The first line of the input contains a single integer $$$t$$$ $$$(1 \leq t \leq 100)$$$, denoting the number of test cases. For each test case:
The first line contains three integers $$$n, m, p$$$ $$$(1 \leq n, m, p \leq 20)$$$, denoting the length of the given three words.
The second line contains three strings consisting of uppercase and lowercase letters, denoting the given three words.
It's guaranteed that the initials of the three words are uppercase letters.
For each test case, output YES if their initials form MST. Otherwise, output NO.
You may print each letter in any case (Yes, yes, Yes will all be recognized as a positive answer, No, no, nO will all be recognized as a negative answer).
24 6 9Most Stupid Technique6 6 4Failed System Test
YES NO
52 8 3My Solution TLE7 5 7Missing Snack Tragedy5 10 10Coins Collecting Foundation7 4 6Awkward Code Merges8 13 4Counting Combinatorial Bits
YES YES NO NO NO
For the first sample test case, the initials of the first three words form MST, but the next three words form FST.
The sample cases here are solely intended to aid understanding of the problem. Any resemblance is purely coincidental.
| Name |
|---|


