#include using namespace std; using ll=long long; using Graph=vector>; #define MOD 998244353 #define INF 1000000000 int main(){ int P; cin>>P; vector N(P),K(P); for(int i=0;i>N.at(i)>>K.at(i); } for(int i=0;i