URI Online Judge | 3078

Só o Ouro

By Jorge Menezes, PUC Goiás BR Brazil

Timelimit: 1

If you went to Goias you've certainly experienced or at least heard about the pequi. The pequi is a typical fruit from the region with some few edible seeds.

In this year ICPC (Instância Competitiva do Pequi Campeão) will take place. The ICPC is a competition to determine the best pequi. To make the competition less obvious and more dynamic, the quality of a pequi with n seeds will be determined by a non-linear equation.

Define  ​​​​\(\textbf{b} = \textbf{n} \hspace{1mm} MOD \hspace{1mm} 257 \),  \(\textbf{c} = \textbf{n} \hspace{1mm} MOD \hspace{1mm} 193\)  and  \(\textbf{d} = \sqrt[22]{\textbf{b}^{16}}*\textbf{b}^{3\over11} - \textbf{b} + 4 \), the equation that determines the quality of the pequi is given by  \(\textbf{x}^{\textbf{d}} + \textbf{bx}^2 + \textbf{c} = 0 \).

Based on the number of roots of the built equation, a pequi can receive one of the following grades of quality:

Your task is given the quantity of seeds to discover the degree of quality of a pequi.

Input

The input consist of several test cases. Each test case has a single line with an integer n (0 ≤ n ≤ 105), the quantity of seeds of the pequi.
The last test case contains n = -1 and must not be processed.

Output

For each test case print on a separate line the degree of quality of the pequi without quotation marks ("So o ouro", "Bom" or "Regular").

Input Sample Output Sample

0
1
-1

Bom
So o ouro