#include int solve(long long V, long long X, int Fo, int Fi, int Q, int R) { long long Y = X; Y += (Fi - Fo) * R; if (Y > V) return 1; Y -= Fo * (Q - R); if (Y < X) return -1; else if (Y > X) return 1; else return 0; } int main() { int T, Fo, Fi, Q, R, ans; long long V, X; scanf("%d", &T); while (T--) { scanf("%lld %lld %d %d %d %d", &V, &X, &Fo, &Fi, &Q, &R); ans = solve(V, X, Fo, Fi, Q, R); if (ans < 0) printf("Zero\n"); else if (ans > 0) printf("Overflow\n"); else printf("Safe\n"); } fflush(stdout); return 0; }