#include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) #define all(x) begin(x), end(x) template bool chmin(T& x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T& x, T y) { return x < y ? (x = y, true) : false; } using i128 = __int128_t; ll powmod(ll x, ll n, ll m) { ll res = 1; while (n) { if (n & 1) res = (i128)res * x % m; x = (i128)x * x % m; n >>= 1; } return res; } void solve() { ll a, b, d, r; cin >> a >> b >> d >> r; { ll gd = gcd(d, r); d /= gd, r /= gd; } ll t = d + r; ll da = r * a; ll db = t * b; if (da > db) cout << "rabbit\n"; else if (da < db) cout << "turtle\n"; else { ll dt = powmod(10, 100, t); if (dt == 0) cout << "tie\n"; else { if ((r * dt + d) / (r + d) * a < b * dt) cout << "turtle\n"; else cout << "rabbit\n"; } } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); int t = 1; cin >> t; while (t--) solve(); }