#include using namespace std; int main() { int T; cin >> T; while(T--) { long long V, X; int F0, F1, Q, R; cin >> V >> X >> F0 >> F1 >> Q >> R; long long A((long long)(F1 - F0) * (long long)R), B(-(long long)F0 * (long long)(Q - R)); string ans; if(A + B == 0) { ans = "Safe"; } if(A + B < 0) { if(X + A <= V) { ans = "Zero"; } else { ans = "Overflow"; } } if(0 < A + B) { if(X + A + B <= 0) { ans = "Zero"; } else { ans = "Overflow"; } } cout << ans << endl; } return 0; }