#include #include #include #include #include #define mod 1000000007 using namespace std; int dp[100010][27]; long long f[100010]; long long pwr(long long a,long long b) { long long r=1; while(b) { if(b%2) { r=(r*a)%mod; } a=(a*a)%mod; b/=2; } return r; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ string s; cin>>s; int i,j; for(i=0;i>q; long long x,y,z; while(q--) { scanf("%d %d",&l,&r); x=0;y=0; for(i=0;i<27;i++) { if(dp[r][i]-dp[l-1][i]==0) continue; if((dp[r][i]-dp[l-1][i])%2) { // cout<0) { x=(x*y)%mod; } cout<