C. Infinite Fence

f:id:peroon:20200826063501p:plain

void ok(){
  p("OBEY");
}
 
void ng(){
  p("REBEL");
}
 
// for codeforces
void solve(){
  ll r,g,k;
  cin>>r>>g>>k;
  ll a = gcd(r,g);
  r /= a;
  g /= a;
  if(r==g){
    ok();
  }
  else{
    if(r<g) swap(r,g);
    // r>gとする
    ll dist = r-1;
    ll num = (dist-1)/g + 1; // 最大充填個数
    if(num<k){
      ok();
    }
    else{
      ng();
    }
  }
}
 
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    // input
    ll N; 
    cin>>N;
    
    while(N--)solve();
    
    return 0;
}