Q=int(input()) for _ in range(Q): a,b,c,d,e,f=map(int,input().split()) z0=((a-1)//e) z1=((d-1)//b) K=abs(z0-z1) mod=998244353 t=pow(10,-K,mod) if z0>z1: result=1-t result%=mod else: result=0 if c>f: result+=t*(10*pow(11,-1,mod)) elif c