#include<bits/stdc++.h>
using namespace std;
unsigned long long secret=154009991;
unsigned long long res=0;
int numberq=0;
int suming(unsigned long long a){
a+=secret;
int ret=0;
while(a>0){
ret+=a%10;
a/=10;
}
return ret;
}
void answering(unsigned long long a){
if(a!=secret)cout<<"wrong answer"<<endl;
5
else cout<<"correct"<<endl;
}
int query(unsigned long long a){
numberq++;
//if(numberq>75)exit(2);
cout<<"query "<<a<<"\n";
//cout<<flush;
int sum;
cin>>sum;
//sum=suming(a);
return sum;
}
void answer(unsigned long long a){
numberq++;
if(numberq>75)exit(2);
cout<<"answer "<<a<<"\n";
cout<<flush;
//answering(a);
}
int main(){
int sum0=query(0);
for(unsigned long long i=1; i<=(unsigned long long)1e18; i*=10){
int l=1;
int d=9;
while(l<=d){
int s=(l+d)/2;
int sum=query(i*s);
if(sum<sum0+s)d=s-1;
else l=s+1;
}
res+=i*(10-l);
}
answer(res);
return 0;
}