/* dsingh_24 */ #include #define ll long long #define pb push_back #define pf push_front #define endl '\n' #define pii pair #define vll vector #define all(a) (a).begin(),(a).end() #define F first #define S second #define sz(x) (ll int)x.size() #define hell 1000000007LL #define rep(i,a,b) for(ll int i=a;i>= 1; } return ans%mod; } ll inv(ll x) { return expo(x,hell-2,hell); } ll a[27][100005],f[100005]; int main() { ios ll i,j,q; string s; cin>>s>>q; f[0]=1; for(i=1;i<=100003;i++) { f[i]=(i*f[i-1])%hell; } for(i=0;i>x>>y; if(x==y){cout<<"1\n";continue;} x-=2;y--; ll in[27]={0},o=0,ss=0; for(i=0;i<26;i++) { if(x==-1)in[i]=a[i][y];else in[i]=a[i][y]-a[i][x]; // cout<