402821: GYM100889 E Everyone wants Khaleesi
Description
Jorah Mormont and Khal Drogo both like the Khaleesi. Why wouldn't they, she's incredibly hot! But only one of them can get her, right? Since battling it out has become a little old-fashioned, they decided to play a game to decide the winner.
There exists a directed acyclic graph with N nodes, numbered from 1 to N, and M directed edges(no self-loops or multi edges). Jorah is at the node 1 initially. The players play turn by turn, Jorah starts. In every turn, Jorah can move along one directed edge from his current position to any node x, if and only if there exists a directed edge from his current node to node x. Also, Khal can remove any one edge he wants in his turn. The game goes on until Jorah reaches node N, or if he is unable to make any valid move. It is guaranteed that between any pair of nodes, there exists at most one edge.
The Khaleesi is waiting at node N. If Jorah is able to reach this node, he gets to keep her, else, Khal does. Assuming both play optimally, who will win?
InputThe first line of input contains number of test cases, T(1 ≤ T ≤ 10). Every test case starts with two integers N and M(2 ≤ N ≤ 100 and 0 ≤ M ≤ 200). Next M lines contain two integers u and v, signifying that there exists a directed edge from node u to node v(1 ≤ u, v ≤ N). It is guaranteed that the resulting graph is acyclic.
OutputThe output must contain T lines. If Jorah wins, output "Jorah Mormont"(without quotes) or else, output "Khal Drogo"(without quotes).
ExampleInput2Output
2 1
1 2
5 6
1 2
1 3
2 3
2 4
3 4
4 5
Jorah MormontNote
Khal Drogo
Sample test case 1:
Jorah moves from node 1 to node 2 and reaches the Khaleesi. Hence, he wins.
Sample test case 2:
Jorah moves from node 1 to node 3. Then Khal removes the edge from node 3 to node 4. Jorah cannot make any more moves, hence Khal wins.