#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> T; while(T--){ ll V,X,F0,F1,Q,R; cin >> V >> X >> F0 >> F1 >> Q >> R; ll x=R*F1-Q*F0; if(F1-F0>0){ if(X+(F1-F0)*R>V){ cout << "Overflow" << endl; continue; } if(x>0) cout << "Overflow" << endl; else if(x==0) cout << "Safe" << endl; else cout << "Zero" << endl; } else cout << "Zero" << endl; } return 0; }