#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; using mint = modint998244353; void solve() { ll v, x, f0, f1, q, r; cin >> v >> x >> f0 >> f1 >> q >> r; if (x + (f1 - f0) * r > v) { cout << "Overflow" << endl; } else { if (r * f1 - q * f0 > 0) { cout << "Overflow" << endl; } else if (r * f1 - q * f0 == 0) { cout << "Safe" << endl; } else { cout << "Zero" << endl; } } } int main() { int t; cin >> t; while (t--) { solve(); } return 0; }