#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; for(int i = 0; (ans == "Unknown") && (i <= 10000); i++) { if(X + (long long)(F1 - F0) * (long long)R <= 0) { ans = "Zero"; continue; } if(V < X + (long long)(F1 - F0) * (long long)R) { ans = "Overflow"; continue; } if(X + (long long)(F1 - F0) * (long long)R - (long long)F0 * (long long)(Q - R) <= 0) { ans = "Zero"; continue; } X = X + (long long)(F1 - F0) * (long long)R - (long long)F0 * (long long)(Q - R); if(i == 10000) { if(X < firstX) { ans = "Zero"; }else { ans = "Overflow"; } } } cout << ans << endl; } return 0; }