#include #include #include #include #include #include using namespace std; int main() { string s,s1; cin>>s1; int t; cin>>t; int a,b; vector vc; vector vi; int f=1; int a1,a2; while(t--) { a1=0; a2=0; vc.clear(); vi.clear(); s=""; cin>>a>>b; s.insert(0,s1,a-1,b-a+1); for(int i=0;i