t = int(input()) while t: t -= 1 v, x, f0, f1, q, r = map(int, input().split()) if f1 * r > q * f0: print("Overflow") elif f1 * r < q * f0: print("Zero") else: if (f1 - f0) * r + x >= v: print("Overflow") else: print("Safe")