L2

After getting bored of the game mentioned in the "L" problem, Lucy and
Luke have decided to create a new one, also about L. The game is played
on a grid paper, and the board is a L-shape, which is here defined as
any shape similar to the following picture. Since we are playing on a
grid, values a, b, c, d can be arbitrary positive integers (and they can
be all different).

[image]

Lucy always starts, and she splits the L-shape into two smaller L-shapes
in any way she wants (again, her cut must go along grid lines); note
that the resulting L-shapes can be rotated (and look more like e.g. Γ).
Then, Luke picks one of the two L-shapes and again splits it into two
smaller L-shapes. And so on. The player who is unable to move loses.

Given a, b, c, d determine who will win, assuming that both players use
the optimal strategy.

Input

Input consists of several cases. Each case is described with a line
a, b, c, d, where 2 ≤ a + c, b + d ≤ 31.

Input ends with 0 0 0 0.

Output

For each test case output who will win (either Lucy or Luke).

In the first case, Lucy is unable to split the L-shape, so she loses.

In the second case, Lucy is able to split into two unsplittable
L-shapes, so she wins.

In the third case, Lucy is able to split into two L-shapes which are
exactly the same (except rotated by 90 degrees). Then, whenever Luke
moves in one of these shapes, Lucy copies his move in the other one.
Finally Lucy will win.

Problem information

Author: Eryk Kopczynski

Generation: 2026-01-25T22:57:13.793Z

© Jutge.org, 2006–2026.
https://jutge.org
