def solve(): v, x, fo, fi, q, r = map(int, input().split()) y = x y += r * (fi - fo) if y > v: print("Overflow") return y -= fo * (q - r) if y > x: print("Overflow") elif y == x: print("Safe") else: print("Zero") for _ in range(int(input())): solve()