#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long int; #define TMAX 10000000000 int main() { int T; cin >> T; rep(i, T) { ll V, X; int Fo, Fi, Q, R; cin >> V >> X >> Fo >> Fi >> Q >> R; ll vo = Fo * (Q - R); ll vi = Fi * R - Fo * R; ll ve = (vi - vo) * (TMAX / Q); if (X - vo <= 0) { cout << "Zero" << endl; continue; } if (ve + X > V) { cout << "Overflow" << endl; continue; } if (ve + X <= 0) { cout << "Zero" << endl; continue; } if (ve + X > 0 && ve + X <= V) { cout << "Safe" << endl; continue; } } return 0; }