#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int T; int main() { cin >> T; vector ans; while(T--) { ll V, X, Fo, Fi, Q, R; cin >> V >> X >> Fo >> Fi >> Q >> R; if((Fi-Fo)*R+X > V) ans.push_back("Overflow"); else if(Fi*R-Fo*Q+X <= 0) ans.push_back("Zero"); else { if(Fi*R-Fo*Q > 0) ans.push_back("Overflow"); else if(Fi*R-Fo*Q < 0) ans.push_back("Zero"); else ans.push_back("Safe"); } } for(auto s : ans) cout << s << endl; }