import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) input = sys.stdin.readline #n = int(input()) #alist = list(map(int,input().split())) #alist = [] #s = input() for i in range(int(input())): v,x,fo,fi,q,r = map(int,input().split()) now = x y = r * (fi-fo) now += y if now <= 0: print('Zero') continue if now > v: print('Overflow') continue y = (q-r) * (0-fo) now += y if now <= 0: print('Zero') continue if now > v: print('Overflow') continue if x-now > 0: print('Zero') elif x-now < 0: print('Overflow') else: print('Safe')