#include using namespace std; #define FOR(i,a,b) for(int i=a;i>n; REP(i,n){ cin>>c[i]>>d[i]; ans+=(((c[i]+1))/2)%mod*(d[i]%mod); } cout<