#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll t, x, v, f1, f2, q, r, d; cin >> t; while (t--){ cin >> v >> x >> f1 >> f2 >> q >> r; d = 0; //1回目: d += (f2-f1) * r; if (x+d > v){ cout << "Overflow" << endl; continue; } d -= f1 * (q-r); if (x+d <= 0){ cout << "Zero" << endl; continue; } //2回目以降 if (d == 0) cout << "Safe" << endl; else if (d > 0) cout << "Overflow" << endl; else cout << "Zero" << endl; } return 0; }