import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 def solve(): v, x, vout, vin, q, r = mi() vin -= vout delta = vin * r - vout * (q - r) if delta > 0: print('Overflow') elif delta < 0: print('Zero') else: d1 = vin * r if x + d1 > v: print('Overflow') else: print('Safe') for _ in range(ii()): solve()