#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long int; 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 = (ll)Fo * (ll)(Q - R); ll vi = (ll)Fi * (ll)R - (ll)Fo * (ll)R; if (X + vi > V) cout << "Overflow" << endl; else if (vi - vo > 0) cout << "Overflow" << endl; else if (vi - vo < 0) cout << "Zero" << endl; else cout << "Safe" << endl; } return 0; }