#include #include #define chmin(x,y) (x) = min((x),(y)) #define chmax(x,y) (x) = max((x),(y)) #define ld long double using namespace std; using namespace atcoder; using ll = long long; const ll mod = 998244353; using mint = modint998244353; using Graph = vector>>; const vector dx = {1,0,-1,0}, dy = {0,1,0,-1}; int main(){ // input int t; cin >> t; while(t--){ ll v,x,fo,fi,q,r; cin >> v >> x >> fo >> fi >> q >> r; ll y = x - fo * q + fi * r; if(y < x) cout << "Zero" << endl; else if(y > x) cout << "Overflow" << endl; else{ // y == x if(x - fo * r + fi * r >= v) cout << "Overflow" << endl; else cout << "Safe" << endl; } } }