# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1") import sys # from bisect import * # from collections import * # from decimal import * # PyPyだと遅い # from heapq import * # from itertools import * # from math import gcd, lcm # from random import * # from string import * # from atcoder.dsu import * # from atcoder.segtree import * # from more_itertools import * # from sortedcontainers import * # sys.setrecursionlimit(10**7) # PyPyは呪文を付ける # sys.set_int_max_str_digits(0) INF = 1 << 61 MOD = 998244353 # MOD = 10**9 + 7 IS_DEBUG = "LOCAL_DEBUG" in sys.argv File = sys.stdin def debug(*args, **kwargs): if IS_DEBUG: print(*args, **kwargs) def input(): return File.readline().replace("\n", "") # /////////////////////////////////////////////////////////////////////////// for _ in range(int(input())): V, X, Fo, Fi, Q, R = map(int, input().split()) p = Fi * R if Fo * Q == p: print("Safe") elif Fo * Q < p: print("Overflow") else: t = X - Fo * R + Fi * R if t > V: print("Overflow") else: print("Zero")