#include using namespace std; void solve(){ using ll=long long; ll a,b,d,r; cin>>a>>b>>d>>r; ll g=gcd(r,d); r/=g;d/=g; ll t=r+d; if (a*r==b*t){ while (t%2==0) t/=2; while (t%5==0) t/=5; if (t==1) cout<<"tie\n"; else cout<<"rabbit\n"; } else if (a*rb*t){ cout<<"rabbit\n"; } } int main(){ int t; cin>>t; while (t--) solve(); }