T = int(input()) for _ in range(T): v,x,fo,fi,q,r = map(int,input().split()) if x+(fi-fo)*r>v: print("Overflow") else: d = fi*r-fo*q if d<0: print("Zero") elif d==0: print("Safe") else: print("Overflow")