The first line of the input contains an integer $T(1\leq T\leq20)$, denoting the number of test cases.
In each test case, there are two integers $n(1\leq n\leq 13)$ and $m(1\leq m\leq 100)$ in the first line, denoting the number of problems and the number of submissions of a team. Problems are labeled by 1001, 1002, ..., $1000+n$.
In the following $m$ lines, each line contains an integer $x(1001\leq x\leq 1000+n)$ and two strings $t(00:00\leq t\leq 05:00)$ and $s$, denoting the team submits problem $x$ at time $t$, and the result is $s$. $t$ is in the format of HH:MM, while $s$ is in the set \{AC, PE, WA, RE, TLE, MLE, OLE\}. The team is so cautious that they never submit a CE code. It is guaranteed that all the $t$ in the input is in ascending order and every $t$ is unique.