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