/*
                         ----------------------------
                              Ankur Kumar Singh    
                         ----------------------------
*/


#include <bits/stdc++.h>
using namespace std;
# define ll  long long  int
# define ld  long double
# define pb push_back
# define pp pop_back
# define ff first
# define ss second
# define mp make_pair
# define ac accumulate
# define mod 1000000007
# define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
# define trace1(x)                cerr << #x << ": " << x << "\n";
# define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << "\n";
# define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << "\n";
# define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << "\n";
void func(ll x,ll y)
{
    ll low,high,xl,xr,yl,yr;
    ll w=-1000000000;
    ll q=1000000000;
       low=x,high=q;
      while(low<=high)
      {
        ll mid=(low+high)/2;
        cout<<mid<<" "<<y<<"\n";
        cout<<flush;
        string c ;
        cin>>c;
         if(c=="CENTER")
        {
          return ;
        }
        if(c!="MISS")
        {
          low=mid+1;
          xr=mid;
        }
        else
        {
          high=mid-1;
        }
      }
      low=w,high=x;
      while(low<=high)
      {
        ll mid=(low+high)/2;
        cout<<mid<<" "<<y<<"\n";
        cout<<flush;
        string c;
        cin>>c;
         if(c=="CENTER")
        {
          return ;
        }
        if(c!="MISS")
        {
          low=mid+1;
          xl=mid;
        }
        else
        {
          high=mid-1;
        }
      }
      low=y,high=q;
       while(low<=high)
      {
        ll mid=(low+high)/2;
        cout<<x<<" "<<mid<<"\n";
        cout<<flush;
        string c ;
        cin>>c;
         if(c=="CENTER")
        {
          return ;
        }
        if(c!="MISS")
        {
          low=mid+1;
          yr=mid;
        }
        else
        {
          high=mid-1;
        }
      }
      low=w,high=y;
      while(low<=high)
      {
        ll mid=(low+high)/2;
        cout<<x<<" "<<mid<<"\n";
        cout<<flush;
        string c;
        cin>>c;
        if(c=="CENTER")
        {
          return ;
        }
        if(c!="MISS")
        {
          low=mid+1;
          yl=mid;
        }
        else
        {
          high=mid-1;
        }
      }
      cout<<(xl+xr)/2<<" "<<(yl+yr)/2<<"\n";
      cout<<flush;
      string c;
      cin>>c;
}
pair<ll,ll> check()
{
      ll M=1e9;
      int in_x, in_y;
    while (1) 
    {
      in_x = rand() % (2 * M + 1) - M;
      in_y = rand() % (2 * M + 1) - M;
      cout<<in_x<<" "<<in_y<<endl;
      string ans ;
      cin>>ans;
      if (ans == "HIT" || ans=="CENTER") 
      { 
        return {in_x,in_y}; 
      }
    }
}
int  main()
{
//   #ifndef ONLINE_JUDGE
//   freopen("in.txt", "r", stdin);
//   freopen("out.txt", "w", stdout);
//   #endif
   IOS;
   ll t;
   cin>>t;  
   ll tt=0;
   while(t--)
   {
      ll a,b;
      cin>>a>>b;
      pair<ll,ll>arr=check();
      func(arr.ff,arr.ss);
   }
   exit(0);
   

}
