#include using namespace std; typedef long long ll; #define mp make_pair #define pb push_back const int M=100005,N=1000000007; int n,m,x,y,a[M],freq[26]; ll fact[M]; string s,z; ll sum; int main() { cin>>s; int q; n=s.size(); cin>>q; fact[1]=1; for(int i=2;i