Duel of Frequencies#12467

Duel of Frequencies

1 second
256 megabytes
Hard

In the ancient ruins of Arithmethia, two rival sorcerers, Kael and Liora, have discovered a sequence of power stones. Each stone possesses a specific magical energy value. Kael channels magic at frequency , while Liora channels magic at frequency .

They decide to play a game to claim the stones. The stones are placed in a pile (the original order does not matter).

The Rules:

Assume both Kael and Liora play optimally to win. Determine who wins the duel.

Input

The first line contains a single integer (1 \le T \le 100) the number of test cases.

Each test case consists of two lines:

  • Three space-separated integers , , and (1 \le N \le 2 \cdot 10^5 , 1 \le X,Y \le 10^9).

  • space-separated integers A_1, A_2, \dots, A_N (1 \le A_i \le 10^9) representing the values of the power stones.

It's guaranteed that the sum of over all test cases does not exceed 2 \cdot 10^5.

Output

For each test case, output a single line containing "Kael" if Kael wins, or "Liora" if Liora wins (without quotes).

Examples

Example 1

Loading
Loading

Note

  • Test Case 1: X=3, Y=4. Kael can pick \{3, 6, 12\}. Liora can pick \{4, 8, 12\}. If Kael starts by picking (divisible by both), he gets an extra turn and must pick again. He picks . His turn ends. Liora picks . Kael picks . Liora picks . Kael has no valid stones left ( are gone), so Liora wins. Even if Kael plays differently, Liora will always win.

  • Test Case 2: X=2, Y=2. Array is \{5, 7, 9\}. Kael goes first but there are no stones divisible by . He immediately has no valid moves and loses. Liora wins.

Scoring

  • Subtask 1 (50 points): N \le 1000. The sum of over all test cases does not exceed .

  • Subtask 2 (100 points): Original constraints.