#include "avoid.h"
#include <bits/stdc++.h>
using namespace std;
pair<int, int> scout(int R, int H){
if (R==10 && H==1){
for (int i=0; i<10; ++i){
vector<int> vv;
for (int j=1; j<=1000; ++j) if (j>>i&1) vv.push_back(j);
send(vv);
}
auto v=wait();
int ans=0;
for (int i=0; i<10; ++i) ans|=v[i]<<i;
return {ans, ans};
}
if (R==20 && H==20){
int l=1, r=1000;
while (l<=r){
int mid=(l+r)>>1;
vector<int> vv(mid-l+1);
iota(vv.begin(), vv.end(), l);
send(vv);
auto v=wait();
if (v[0]) r=mid-1;
else l=mid+1;
}
pair<int, int> ans={-1, -1};
ans.first=l;
l=ans.first+1, r=1000;
while (l<=r){
int mid=(l+r)>>1;
vector<int> vv(mid-l+1);
iota(vv.begin(), vv.end(), l);
send(vv);
auto v=wait();
if (v[0]) r=mid-1;
else l=mid+1;
}
ans.second=l;
if (ans.second==1001) ans.second=ans.first;
return ans;
}
return {-1, -1};
}