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