In the heart of bustling Hong Kong, a unique cultural experience awaits: the thrill of playing Ping Pong Pinball machines outside vibrant stationery shops. These shops, brimming with colorful pens, stacks of notebooks, and artistic supplies, often feature these captivating machines as a draw for young and old alike.
A Ping Pong Pinball machine. At a Ping Pong Pinball machine, players can play a game with a $1 coin, potentially winning attractive prizes. In each game, the player pings 5 table tennis balls one by one, each independently and uniformly falling into one of the 5 vertical slots. At the end of the game, the player will be awarded the basic prize if four balls land in a single row (either horizontally or vertically), or the grand prize if all five balls land in a single row (either horizontally or vertically).
You are now observing Alice playing the game outside a stationery shop. After Alice pinged the first 3 balls, you noted down the current distribution of balls across the five vertical slots. You are now wondering whether it is still possible for Alice to win the basic prize and/or the grand prize by (luckily) pinging the 2 remaining balls.
The input consists of 5 integers $$$C_1, C_2, C_3, C_4, C_5$$$ ($$$0 \leq C_i \leq 3$$$). Here, $$$C_i$$$ denotes the number of balls in the $$$i$$$-th vertical slot.
It is guaranteed that Alice has pinged exactly 3 balls, i.e., $$$C_1 + C_2 + C_3 + C_4 + C_5 = 3$$$.
If it is possible for Alice to win the grand prize in the current game, output op.
Otherwise, if it is possible for Alice to win the basic prize in the current game, output add oil.
If it is not possible for Alice to win any prizes in the current game, output gg.
1 2 0 0 0
add oil
1 0 1 0 1
op
Sample 1:
It is possible to win the basic prize by pinging the remaining balls into slot 2, forming a vertical line, or slots 3 and 4 respectively, forming a horizontal line. However, it is impossible to win the grand prize regardless of how the remaining balls are pinged.
![]() | $$$\Rightarrow$$$ | ![]() | ![]() |
Sample 2:
It is possible to win the grand prize by pinging the remaining balls into slots 2 and 4 respectively, forming a horizontal line.
![]() | $$$\Rightarrow$$$ | ![]() |