#include using namespace std; int main() { int T; cin >> T; while(T--) { long long V, X; int F0, F1, Q, R; cin >> V >> X >> F0 >> F1 >> Q >> R; string ans("Unknown"); if(X == X + (long long)(F1 - F0) * (long long)R - (long long)F0 * (long long)(Q - R)) { ans = "Safe"; } long long firstX = X; if(ans == "Unknown") { for(int i = 0; (i <= 100010); i++) { X += (long long)(F1 - F0) * (long long)R; if(V < X) { ans = "Overflow"; break; } if(X <= 0LL) { ans = "Zero"; break; } X -= (long long)F0 * (long long)(Q - R); if(X <= 0LL) { ans = "Zero"; break; } if(i == 100000) { if(X < firstX) { ans = "Zero"; }else { ans = "Overflow"; } } } } cout << ans << endl; } return 0; }