#include using namespace std; //#include //using namespace atcoder; using ll = long long int; using ull = unsigned long long int; using ld = long double; constexpr ll MAX = 2000000000000000000; constexpr ld PI = 3.14159265358979; constexpr ll MOD = 0;//2024948111; ld dotorad(ld K){ return PI * K / 180.0; } ld radtodo(ld K){ return K * 180.0 / PI; } mt19937 mt; void randinit(){ srand((unsigned)time(NULL));mt = mt19937(rand()); } void solve(){ ll V,X,Fout,Fin,Q,R; cin >> V >> X >> Fout >> Fin >> Q >> R; ll x = X; X -= R * Fout; X += R * Fin; if(X > V){ cout << "Overflow" << endl; return; } X -= (Q - R) * Fout; if(X <= 0 || x > X){ cout << "Zero" << endl; } else if(x < X){ cout << "Overflow" << endl; } else{ cout << "Safe" << endl; } } int main(){ ll T; cin >> T; for(ll i = 0; i < T; i++) solve(); }