T = int(input()) assert 1 <= T <= 1000 for _ in range(T): V, X, Fo, Fi, Q, R = map(int, input().split()) assert 1 <= X <= V <= 10 ** 18 assert 1 <= Fo <= 10 ** 9 assert 1 <= Fi <= 10 ** 9 assert 1 <= R < Q <= 10 ** 9 if X + R * (Fi - Fo) > V: print("Overflow") else: if R * Fi - Q * Fo > 0: print("Overflow") elif R * Fi - Q * Fo < 0: print("Zero") else: print("Safe")