#include #include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ string s; cin>>s; int q; cin>>q; while(q--) { int l; int r; cin>>l>>r; if((r-l)==1) { cout<<1<