/* ****GT_18**** */ #include #define ll long long #define pb push_back #define endl '\n' #define pii pair #define vi vector #define all(a) (a).begin(),(a).end() #define F first #define S second #define sz(x) (ll int)x.size() #define hell 1000000007 #define rep(i,a,b) for(ll int i=a;i>= 1; } return ans%mod; } vi fac(N,0),inv(N,0); void cal_fac() { fac[0]=1; rep(i,1,N) fac[i]=(i*fac[i-1])%hell; rep(i,0,N) inv[i]=expo(fac[i],hell-2,hell); } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int TESTS=1; // cin>>TESTS; while(TESTS--) { string s; cin>>s; ll q; cin>>q; ll f[sz(s)][30]={0}; f[0][s[0]-'a']=1; rep(i,1,sz(s)) { rep(j,0,26) f[i][j]=f[i-1][j]; f[i][s[i]-'a']++; } cal_fac(); // rep(i,0,15) // cout<>l>>r; l--; r--; ll o=0; ll ans=1; vi fr(26,0); rep(i,0,26) { fr[i]=f[r][i]; if(l) fr[i]-=f[l-1][i]; if(fr[i]%2) o++; fr[i]/=2; } // rep(i,0,26) cout<