JNK - Journey of nikki

no tags 

Nikki the programmer lives in the middle of the Programming subway branch. she has two friends: Bumblebee and Optimus, who live at the different ends of the branch, each one is unaware of the other one's existence.

When Nikki has some free time, she goes to one of her friends. she descends into the subway at some time, waits the first train to come and rides on it to the end of the branch to the corresponding friend. However, the trains run with different frequencies: a train goes to Bumblebee's direction every 'a' minutes, but a train goes to Optimus's direction every 'b' minutes. If two trains approach at the same time, Nikki goes toward the direction with the lower frequency of going trains, that is, to the friend, to whose directions the trains go less frequently (see the note to the third sample).

We know that the trains begin to go simultaneously before Nikki appears. That is the train schedule is such that there exists a moment of time when the two trains arrive simultaneously.

Help Nikki count to which friend she will go more often.

Input

The first line of input contains an integer T (T <= 100), the number of test cases in the input. T lines follow, one for each test case, each containing contains two integers a and b (a ≠ b, 1 <= a, b <= 10^6).

Output

for each test case print "bumblebee" if Nikki will go to Bumblebee more frequently, "optimus" if she will go to Optimus more frequently, or "equal" if she will go to both friends with the same frequency.

Example

Input:
3
3 7
5 3
2 3a

output:
bumblebee
optimus
equal

Note

Let's take a look at the third sample. Let the trains start to go at the zero moment of time. It is clear that the moments of the trains' arrival will be periodic with period 6. That's why it is enough to show that if Nikki descends to the subway at a moment of time inside the interval (0, 6], she will go to both friends equally often.

  • If she descends to the subway at a moment of time from 0 to 2, she leaves for Bumblebee on the train that arrives by the second minute.
  • If she descends to the subway at a moment of time from 2 to 3, she leaves for Optimus on the train that arrives by the third minute.
  • If she descends to the subway at a moment of time from 3 to 4, she leaves for Bumblebee on the train that arrives by the fourth minute.
  • If she descends to the subway at a moment of time from 4 to 6, she waits for both trains to arrive by the sixth minute and goes to Optimus as trains go less often in Optimus's direction.

In sum Optimus and Bumblebee get equal time - three minutes for each one, thus, Nikki will go to both friends equally often.


hide comments
nadstratosfer: 2018-08-15 07:50:22

Interesting one. Solved based on simulation results, don't understand the pattern though. Any hint?


Added by:BLANKRK
Date:2014-08-23
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:AASFPC