#include using namespace std; using ll = long long; int main() { int T; cin >> T; while (T--) { ll V, X, Fo, Fi, Q, R; cin >> V >> X >> Fo >> Fi >> Q >> R; if (R * Fi - Q * Fo > 0) { cout << "Overflow" << endl; } else if (R * Fi - Q * Fo == 0) { cout << "Safe" << endl; } else { cout << "Zero" << endl; } } }