#include typedef long long ll; using namespace std; const int mod = 998244353; ll pw(ll x,ll y){ll a=1;while(y){if(y%2)a=a*x%mod;x=x*x%mod;y/=2;}return a;} ll inv(ll x){return pw(x,mod-2);} int main() { cin.tie(0) -> sync_with_stdio(false); int t; cin >> t; while (t--) { ll a, b, c; cin >> a >> b >> c; cout << (a*a + b*b + c*c) % mod * inv(c*c % mod) % mod << '\n'; } }