import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd def sol(): v,x,fo,fi,q,r = map(int,input().split()) if r*(fi-fo) + x > v: print("Overflow") return tot = (r)*fi - fo*q if tot == 0: print("Safe") elif tot < 0: print("Zero") else: print("Overflow") return T = int(input()) for i in range(T): sol()