#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; ll dp[100100][7]; const int MOD=1e9+7; ll A[]={1,3,2,6,4,5}; ll B[]={0,1,4,6,5,2}; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int k; cin>>k; vector D(k),L(k); rep(i,k) cin>>D[i]>>L[i]; dp[0][0]=1; for(int i=0;i