#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); ll t; cin >> t; while (t--) { ll a, b, d, r; cin >> a >> b >> d >> r; ll s = r + d; if (b * s == a * d) { while (s % 2 == 0) { s /= 2; } while (s % 5 == 0) { s /= 5; } cout << (s != 1 ? "rabbit" : "tie") << endl; } else { cout << (b * s > a * d ? "turtle" : "rabbit") << endl; } } return 0; }