#include #include #define MOD 1000000007 using namespace std; typedef long long ll; string s; int q; ll mat[100005][30]; ll f[100005]; ll arr[30]; long long pow(ll a, ll b) { long long x=1,y=a; while(b > 0) { if(b%2 == 1) { x=(x*y); if(x>MOD) x%=MOD; } y = (y*y); if(y>MOD) y%=MOD; b /= 2; } return x; } long long InverseEuler(ll n) { return pow(n,MOD-2); } long long C(ll n, ll r) { return (f[n]*((InverseEuler(f[r]) * InverseEuler(f[n-r])) % MOD)) % MOD; } int main() { ios_base::sync_with_stdio(0); f[0]=1; for(ll i=1;i<=100002;i+=1LL) { f[i]=f[i-1]*i; if(f[i]>=MOD) f[i]%=MOD; } /* for(int i=0;i<10000;i++) cout<>s; for(int i=0;i>q; while(q--) { int l,r; cin>>l>>r; for(int i=1;i<=26;i++) arr[i]=mat[r][i]-mat[l-1][i]; /*for(int i=1;i<=26;i++) cout<1) { ll num; if(arr[i]%2==0) num=arr[i]; else num=arr[i]-1; up+=num; } } for(int i=1;i<=26;i++) { if(arr[i]>1) { ll num; if(arr[i]%2==0) num=arr[i]; else num=arr[i]-1; arr[i]-=num; ans*=C(up/2,num/2); ans%=MOD; up-=num; } } ll rest=0; for(int i=1;i<=26;i++) { if(arr[i]==1) rest++; } if(rest>0) { ans*=rest; } ans%=MOD; cout<