#include using namespace std; long long mod = 998244353; //入力が必ず-mod= mod) v -= mod; return *this; } mint operator-=(const mint b){ v -= b.v; if(v < 0) v += mod; return *this; } mint operator*=(const mint b){v = v*b.v%mod; return *this;} mint operator/=(mint b){ if(b == 0) assert(false); int left = mod-2; while(left){if(left&1) *this *= b; b *= b; left >>= 1;} return *this; } mint operator++(){*this += 1; return *this;} mint operator--(){*this -= 1; return *this;} mint operator++(int){*this += 1; return *this;} mint operator--(int){*this -= 1; return *this;} bool operator==(const mint b)const{return v == b.v;} bool operator!=(const mint b)const{return v != b.v;} bool operator>(const mint b)const{return v > b.v;} bool operator>=(const mint b)const{return v >= b.v;} bool operator<(const mint b)const{return v < b.v;} bool operator<=(const mint b)const{return v <= b.v;} mint pow(long long n)const{ mint ret = 1,p = v; if(n < 0) p = p.inv(),n = -n; while(n){ if(n&1) ret *= p; p *= p; n >>= 1; } return ret; } mint inv()const{return mint(1)/v;} }; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while(T--){ mint a,b,c; cin >> a.v >> b.v >> c.v; mint answer = c*c+b*b+a*a; answer /= c*c; cout << answer.v << "\n"; } }