#include using namespace std; /*/ #include using namespace atcoder; //*/ #define rep(i,n) for(int i=0;i; using ll = long long; using ull = unsigned long long; //*/ template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } typedef pair pii; typedef pair pll; typedef vector vll; typedef vector vint; void solve(){ ll v,x,f1,f2,q,r; cin >> v >> x >> f1 >> f2 >> q >> r; ll x1 = x; x += (f2-f1)*r; if(x > v){ cout << "Overflow" << endl; return; } x -= f1*(q-r); if(x > x1){ cout << "Overflow" << endl; }else if(x == x1){ cout << "Safe" << endl; }else{ cout << "Zero" << endl; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; rep(i,t) solve(); }