#P9862. Nukit: The Nuclear Reaction Game

    ID: 23007 Type: Default 1000ms 256MiB

Nukit: The Nuclear Reaction Game

Nukit: The Nuclear Reaction Game

Canada’s top two nuclear scientists, Patrick and Roland, have built the world’s first nuclear fission reactor. To beat the monotony of constant reactor operations, they invented a new game called Nukit. In this game, a collection of particles is placed in the reactor. There are 4 types of particles: A, B, C, and D. The players take turns applying one of the following 5 reactions, with Patrick always moving first.

Each reaction describes a set of particles that are destroyed in one move. The allowed reactions are:

  • $1.$ \( AABDD \): removes 2 A's, 1 B, and 2 D's.
  • $2.$ \( ABCD \): removes 1 A, 1 B, 1 C, and 1 D.
  • $3.$ \( CCD \): removes 2 C's and 1 D.
  • $4.$ \( BBB \): removes 3 B's.
  • $5.$ \( AD \): removes 1 A and 1 D.

On a turn, a player must choose a reaction that can be applied (i.e. the reactor must contain at least as many of each particle as required by the reaction). The reaction is performed and the corresponding particles are destroyed. The game ends when a player is unable to perform any reaction on their turn, and that player loses.

Assuming both players play optimally, determine who has the winning strategy given the initial counts of particles.

inputFormat

The input consists of a single line containing four non-negative integers separated by spaces: the numbers of particles A, B, C, and D respectively.

outputFormat

Output Patrick if the first player (Patrick) has a winning strategy; otherwise, output Roland.

sample

1 5 0 3
Roland

</p>