#include using namespace std; #if __has_include("all.hpp") #include "all.hpp" #else #include #endif using namespace atcoder; using mint=modint998244353; int main(void){ int t; cin>>t; while(t--){ long long hc,ac,sc,hg,ag,sg; cin>>hc>>ac>>sc>>hg>>ag>>sg; long long shc=(hc-1)/ag,shg=(hg-1)/ac; { long long tmp=min(shc,shg); shc-=tmp; shg-=tmp; } if(shg==0){ mint tmp=1; tmp*=((mint)1/10).pow(shc); tmp/=11; if(sc>sg){ }else if(scsg){ tmp*=10; }else{ tmp+=tmp*10; tmp/=2; } cout<