PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000094. Hàng rào vô tận (Infinite Fence)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Hàng rào vô tận (Infinite Fence)

Infinite Fence

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

A fence consists of 1010010^{100} planks indexed from 00. A plank whose index is divisible by rr must be painted red, and one divisible by bb must be painted blue. If an index is divisible by both, either color may be chosen. All other planks must remain unpainted. Consider only painted planks in increasing index order, skipping unpainted planks. Determine whether it is possible to avoid having kk consecutive painted planks of the same color. Print OBEY if possible and REBEL otherwise.

Input

One line containing three integers r,b,kr,b,k.

Output

Print exactly OBEY or REBEL.

Subtasks

  • Subtask 1 (20 points): 1≤r,b≤1001\le r,b\le100; 2≤k≤1002\le k\le100.
  • Subtask 2 (30 points): 1≤r,b≤1051\le r,b\le10^5; 2≤k≤1052\le k\le10^5.
  • Subtask 3 (50 points): 1≤r,b≤1091\le r,b\le10^9; 2≤k≤1092\le k\le10^9.

Examples

Input

2 10 4

Output

REBEL

Explanation

Indices 2,4,6,82,4,6,8 must be red. They form four consecutive painted planks before index 1010, where either color is allowed. Since k=4k=4, a forbidden run is unavoidable and the output is REBEL.