N = int(input()) for i in range(N): V, X, Fo, Fi, Q, R = map(int, input().split()) C = Fi * R - Fo * Q if C > 0 and C * 10 ** 100 > V - X: print("Overflow") elif C < 0 and C * 10 ** 100 < X: print("Zero") else: print("Safe")