#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)%mod/2)*d[i]%mod; } cout<