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:
Kael goes first, and they alternate turns.
On his turn, Kael must pick a stone from the pile with a value divisible by .
On her turn, Liora must pick a stone from the pile with a value divisible by .
The Mystic Multiplier: If a player picks a stone that is divisible by both and , they are granted an immediate extra move. They must immediately pick another valid stone. They continue to take extra moves as long as they pick stones divisible by both and .
If a player cannot make a valid move on their turn, they lose immediately.
Each stone can only be picked once.
Assume both Kael and Liora play optimally to win. Determine who wins the duel.
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.
For each test case, output a single line containing "Kael" if Kael wins, or "Liora" if Liora wins (without quotes).
Example 1
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.
Subtask 1 (50 points): N \le 1000. The sum of over all test cases does not exceed .
Subtask 2 (100 points): Original constraints.