#include using namespace std; #define int long long signed main(){ int T; cin>>T; int mod = 998244353; while(T--){ int N,M; cin>>N>>M; int a = 1, b = 0, c = 0; for(int i=0;i