//are you still there? #include #define int long long #define MX 100005 #define mod 1000000007 using namespace std; int ara[MX][28], ara2[MX], ara3[MX]; string str; int bigmod(int a, int b){ if(b==0) return 1%mod; int x = bigmod(a, b/2); x = (x*x)%mod; if(b%2) x = (x*a)%mod; return x; } int32_t main(){ //freopen("in.txt", "r", stdin); int n, i, j, ans, k, x, a, t, q, l, r, b; cin >> str >> q; memset(ara, 0, sizeof ara); for(i=0;i> l >> r; t = r-l+1; ans = 1; a = 0; k = 0; for(i=0;i<26;i++){ b = (ara[r][i] - ara[l-1][i]); if(b%2) k++; b/=2; a += b; ans *= bigmod(ara2[b], mod-2); ans %= mod; } //cout << k << endl; ans *= ara2[a]; ans %= mod; if(k){ ans *= k; ans%= mod; } cout << ans << endl; } return 0; }