/*
   Salim Shebli
   Russian,Syrian
   Faculty Of Information Technology
   University of Damascus
   Game Developer
 */
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
ll n,k;
ll cc;
vector<ll>g[100100];
bool vis[100100];
stack<ll>z;
ll pos[100100];
vector<ll>col[3];
vector<ll>ck;
bool dfs(int v,int p,bool c)
{
    vis[v]=1;
    z.push(v);
    pos[v]=z.size();//<<endl;
   // cout<<v<<" "<<pos[v]<<endl;
    col[c].pb(v);
    ll bbest=1e7;
    ll id=-1;
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i];
        if(p==to)continue;
        if(vis[to])
        {
            if(pos[v]-pos[to]+1<bbest)
            {
                bbest=pos[v]-pos[to]+1;
                id=to;
            }
        }
    }
    if(id!=-1)
    {
        while(z.size()!=0)
        {
            ll f=z.top();
            z.pop();
            ck.pb(f);
            if(f==id)break;
        }
        return 1;
    }
    for(int i=0;i<g[v].size();i++)
    {
        ll to=g[v][i];
        if(!vis[to])
        {
            bool ss=dfs(to,v,!c);
            if(ss)return 1;
        }
    }
    z.pop();
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
    ll m;
    cin>>n>>m>>k;
    cc=k/2+(k%2);
    for(int i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    bool ss=dfs(1,-1,0);
 //   cout<<ss<<endl;
    if(!ss)
    {
        vector<ll>ww;
        if(col[0].size()>col[1].size())
        {
            ww=col[0];
        }
        else ww=col[1];
        cout<<1<<endl;
        for(int i=0;i<min(cc,(ll)ww.size());i++)
        {
            cout<<ww[i]<<" ";
        }
        cout<<endl;
        return 0;
    }
    if(ck.size()<=k)
    {
        cout<<2<<endl;
        cout<<ck.size()<<endl;
        for(int i=0;i<ck.size();i++)
        {
            cout<<ck[i]<<" ";
        }
        cout<<endl;
        return 0;
    }
    vector<ll>ww;
    for(int i=0;i<ck.size();i++)
    {
        if(i%2==0&&i!=ck.size()-1)
        {
            ww.pb(ck[i]);
        }
    }
     cout<<1<<endl;
        for(int i=0;i<min(cc,(ll)ww.size());i++)
        {
            cout<<ww[i]<<" ";
        }
        cout<<endl;
        return 0;

}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

int N,M,K;
vector<vector<int>> g;

vector<int> cycle;
int goal;
bool cyc;
vector<int> vis;
vector<int> inds;

void dfs(int now,int par,int col){
  vis[now]=col;
  if(col==1) inds.push_back(now);

  for(auto nex:g[now]){
    if(par==nex) continue;
    if(vis[nex]!=0){
      goal=nex;
      cyc=true;
      cycle.push_back(now);
      return;
    }

    dfs(nex,now,-col);

    if(cyc){
      if(goal!=-1) cycle.push_back(now);
      if(goal==now) goal=-1;
      return;
    }
  }
}

void outputIND(vector<int> &ind){
    cout<<1<<endl;
    rep(i,ind.size()) cout<<ind[i]+1<<" ";
    cout<<endl;
}

void outputCYC(vector<int> &cyc){
    cout<<2<<endl;
    cout<<cyc.size()<<endl;
    rep(i,cyc.size()) cout<<cyc[i]+1<<" ";
    cout<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin>>N>>M>>K;
  g.resize(N);
  rep(i,M){
    int a,b;
    cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vis.resize(N,0);
  cyc=false;
  goal=-1;

  dfs(0,-1,1);

  if(cycle.size()){
      int P=cycle.size();
      if(P>K){
          int l=0,r=P-1;
          vector<int> pos(N,-1);
          rep(i,P) pos[cycle[i]]=i;
          for(int i=0;i<P;i++){
              int now=cycle[i];
              for(auto nex:g[now]){
                  if(i>r) break;
                  if(i<l) break;
                  if(pos[nex]==-1) continue;
                  if(pos[nex]<l||pos[nex]>r){
                      pos[nex]=-1;
                      continue;
                  }
                  if(abs(i-pos[nex])<=1) continue;

                  if(pos[nex]<i){
                      r=i;
                      chmax(l,pos[nex]);
                  }else{
                      l=i;
                      chmin(r,pos[nex]);
                  }
              }
          }

          vector<int> sc;
          for(int i=l;i<=r;i++) sc.push_back(cycle[i]);

          if(sc.size()<=K) outputCYC(sc);
          else{
              vector<int> inds;
              rep(i,sc.size()) if(i%2==0&&i+1<sc.size()) inds.push_back(sc[i]);
              while(inds.size()>(K+1)/2) inds.pop_back();
              outputIND(inds);
          }
      }else{
          outputCYC(cycle);
      }
  }else{
    if(inds.size()<(K+1)/2){
        inds.clear();
        rep(i,N) if(vis[i]==-1) inds.push_back(i);
    }
    while(inds.size()>(K+1)/2) inds.pop_back();
    outputIND(inds);
  }

  return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

int N,M,K;
vector<vector<int>> g;

vector<int> cycle;
int goal;
bool cyc;
vector<int> vis;
vector<int> inds;

void dfs(int now,int par,int col){
  vis[now]=col;
  if(col==1) inds.push_back(now);

  for(auto nex:g[now]){
    if(par==nex) continue;
    if(vis[nex]!=0){
      goal=nex;
      cyc=true;
      cycle.push_back(now);
      return;
    }

    dfs(nex,now,-col);

    if(cyc){
      if(goal!=-1) cycle.push_back(now);
      if(goal==now) goal=-1;
      return;
    }
  }
}

void outputIND(vector<int> &ind){
    cout<<1<<endl;
    rep(i,ind.size()) cout<<ind[i]+1<<" ";
    cout<<endl;
}

void outputCYC(vector<int> &cyc){
    cout<<2<<endl;
    cout<<cyc.size()<<endl;
    rep(i,cyc.size()) cout<<cyc[i]+1<<" ";
    cout<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin>>N>>M>>K;
  g.resize(N);
  rep(i,M){
    int a,b;
    cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vis.resize(N,0);
  cyc=false;
  goal=-1;

  dfs(0,-1,1);

  if(cycle.size()){
      int P=cycle.size();
      if(P>K){
          int l=0,r=P-1;
          vector<int> pos(N,-1);
          rep(i,P) pos[cycle[i]]=i;
          for(int i=0;i<P;i++){
              int now=cycle[i];
              for(auto nex:g[now]){
                  if(i>r) break;
                  if(i<l) break;
                  if(pos[nex]==-1) continue;
                  if(nex<l||nex>r){
                      pos[nex]=-1;
                      continue;
                  }
                  if(abs(i-pos[nex])<=1) continue;

                  if(pos[nex]<i){
                      r=i;
                      l=pos[nex];
                  }else{
                      l=i;
                      r=pos[nex];
                  }
              }
          }

          vector<int> sc;
          for(int i=l;i<=r;i++) sc.push_back(cycle[i]);

          if(sc.size()<=K) outputCYC(sc);
          else{
              vector<int> inds;
              rep(i,sc.size()) if(i%2==0&&i+1<sc.size()) inds.push_back(sc[i]);
              outputIND(inds);
          }
      }else{
          outputCYC(cycle);
      }
  }else{
    if(inds.size()<(K+1)/2){
        inds.clear();
        rep(i,N) if(vis[i]==-1) inds.push_back(i);
    }
    outputIND(inds);
  }

  return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

int N,M,K;
vector<vector<int>> g;

vector<int> cycle;
int goal;
bool cyc;
vector<int> vis;
vector<int> inds;

void dfs(int now,int col){
  vis[now]=col;
  if(col==1) inds.push_back(now);

  for(auto nex:g[now]){
    if(vis[nex]!=0){
      if(vis[nex]!=vis[now]) continue;
      goal=nex;
      cyc=true;
      cycle.push_back(now);
      return;
    }

    dfs(nex,-col);

    if(cyc){
      if(goal!=-1) cycle.push_back(now);
      if(goal==now) goal=-1;
      return;
    }
  }
}

void outputIND(vector<int> &ind){
    cout<<1<<endl;
    rep(i,ind.size()) cout<<ind[i]+1<<" ";
    cout<<endl;
}

void outputCYC(vector<int> &cyc){
    cout<<2<<endl;
    cout<<cyc.size()<<endl;
    rep(i,cyc.size()) cout<<cyc[i]+1<<" ";
    cout<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin>>N>>M>>K;
  g.resize(N);
  rep(i,M){
    int a,b;
    cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vis.resize(N,0);
  cyc=false;
  goal=-1;

  dfs(0,1);

  if(cycle.size()){
      int P=cycle.size();
      if(P>K){
          int l=0,r=P-1;
          vector<int> pos(N,-1);
          rep(i,P) pos[cycle[i]]=i;
          for(int i=0;i<P;i++){
              int now=cycle[i];
              if(i>r) break;
              for(auto nex:g[now]){
                  if(pos[nex]==-1) continue;
                  if(nex<l||nex>r){
                      pos[nex]=-1;
                      continue;
                  }

                  if(pos[nex]<i){
                      r=i;
                      l=pos[nex];
                  }else{
                      l=i;
                      r=pos[nex];
                  }
              }
          }

          vector<int> sc;
          for(int i=l;i<=r;i++) sc.push_back(cycle[i]);

          if(sc.size()<=K) outputCYC(sc);
          else{
              vector<int> inds;
              rep(i,sc.size()) if(i%2==0) inds.push_back(sc[i]);
              outputIND(inds);
          }
      }else{
          outputCYC(cycle);
      }
  }else{
    if(inds.size()<(K+1)/2){
        inds.clear();
        rep(i,N) if(vis[i]==-1) inds.push_back(i);
    }
    outputIND(inds);
  }

  return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

int N,M,K;
vector<vector<int>> g;

vector<int> cycle;
int goal;
bool cyc;
vector<int> vis;
vector<int> inds;

void dfs(int now,int par,int col){
  vis[now]=col;
  if(col==1) inds.push_back(now);

  for(auto nex:g[now]){
    if(par==nex) continue;
    if(vis[nex]!=0){
      goal=nex;
      cyc=true;
      cycle.push_back(now);
      return;
    }

    dfs(nex,now,-col);

    if(cyc){
      if(goal!=-1) cycle.push_back(now);
      if(goal==now) goal=-1;
      return;
    }
  }
}

void outputIND(vector<int> &ind){
    cout<<1<<endl;
    rep(i,ind.size()) cout<<ind[i]+1<<" ";
    cout<<endl;
}

void outputCYC(vector<int> &cyc){
    cout<<2<<endl;
    cout<<cyc.size()<<endl;
    rep(i,cyc.size()) cout<<cyc[i]+1<<" ";
    cout<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin>>N>>M>>K;
  g.resize(N);
  rep(i,M){
    int a,b;
    cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vis.resize(N,0);
  cyc=false;
  goal=-1;

  dfs(0,-1,1);

  if(cycle.size()){
      int P=cycle.size();
      if(P>K){
          int l=0,r=P-1;
          vector<int> pos(N,-1);
          rep(i,P) pos[cycle[i]]=i;
          for(int i=0;i<P;i++){
              int now=cycle[i];
              for(auto nex:g[now]){
                  if(i>r) break;
                  if(i<l) break;
                  if(pos[nex]==-1) continue;
                  if(pos[nex]<l||pos[nex]>r){
                      pos[nex]=-1;
                      continue;
                  }
                  if(abs(i-pos[nex])<=1) continue;

                  if(pos[nex]<i){
                      r=i;
                      chmax(l,pos[nex]);
                  }else{
                      l=i;
                      chmin(r,pos[nex]);
                  }
              }
          }

          vector<int> sc;
          for(int i=l;i<=r;i++) sc.push_back(cycle[i]);

          if(sc.size()<=K) outputCYC(sc);
          else{
              vector<int> inds;
              rep(i,sc.size()) if(i%2==0&&i+1<sc.size()) inds.push_back(sc[i]);
              outputIND(inds);
          }
      }else{
          outputCYC(cycle);
      }
  }else{
    if(inds.size()<(K+1)/2){
        inds.clear();
        rep(i,N) if(vis[i]==-1) inds.push_back(i);
    }
    outputIND(inds);
  }

  return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

int N,M,K;
vector<vector<int>> g;

vector<int> cycle;
int goal;
bool cyc;
vector<int> vis;
vector<int> inds;

void dfs(int now,int par,int col){
  vis[now]=col;
  if(col==1) inds.push_back(now);

  for(auto nex:g[now]){
    if(par==nex) continue;
    if(vis[nex]!=0){
      goal=nex;
      cyc=true;
      cycle.push_back(now);
      return;
    }

    dfs(nex,now,-col);

    if(cyc){
      if(goal!=-1) cycle.push_back(now);
      if(goal==now) goal=-1;
      return;
    }
  }
}

void outputIND(vector<int> &ind){
    cout<<1<<endl;
    rep(i,ind.size()) cout<<ind[i]+1<<" ";
    cout<<endl;
}

void outputCYC(vector<int> &cyc){
    cout<<2<<endl;
    cout<<cyc.size()<<endl;
    rep(i,cyc.size()) cout<<cyc[i]+1<<" ";
    cout<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin>>N>>M>>K;
  g.resize(N);
  rep(i,M){
    int a,b;
    cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vis.resize(N,0);
  cyc=false;
  goal=-1;

  dfs(0,-1,1);

  if(cycle.size()){
      int P=cycle.size();
      if(P>K){
          int l=0,r=P-1;
          vector<int> pos(N,-1);
          rep(i,P) pos[cycle[i]]=i;
          for(int i=0;i<P;i++){
              int now=cycle[i];
              for(auto nex:g[now]){
                  if(i>r) break;
                  if(i<l) break;
                  if(pos[nex]==-1) continue;
                  if(pos[nex]<l||pos[nex]>r){
                      pos[nex]=-1;
                      continue;
                  }
                  if(abs(i-pos[nex])<=1) continue;

                  if(pos[nex]<i){
                      r=i;
                      l=pos[nex];
                  }else{
                      l=i;
                      r=pos[nex];
                  }
              }
          }

          vector<int> sc;
          for(int i=l;i<=r;i++) sc.push_back(cycle[i]);

          if(sc.size()<=K) outputCYC(sc);
          else{
              vector<int> inds;
              rep(i,sc.size()) if(i%2==0&&i+1<sc.size()) inds.push_back(sc[i]);
              outputIND(inds);
          }
      }else{
          outputCYC(cycle);
      }
  }else{
    if(inds.size()<(K+1)/2){
        inds.clear();
        rep(i,N) if(vis[i]==-1) inds.push_back(i);
    }
    outputIND(inds);
  }

  return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

int N,M,K;
vector<vector<int>> g;

vector<int> cycle;
int goal;
bool cyc;
vector<int> vis;
vector<int> inds;

void dfs(int now,int par,int col){
  vis[now]=col;
  if(col==1) inds.push_back(now);

  for(auto nex:g[now]){
    if(par==nex) continue;
    if(vis[nex]!=0){
      goal=nex;
      cyc=true;
      cycle.push_back(now);
      return;
    }

    dfs(nex,now,-col);

    if(cyc){
      if(goal!=-1) cycle.push_back(now);
      if(goal==now) goal=-1;
      return;
    }
  }
}

void outputIND(vector<int> &ind){
    cout<<1<<endl;
    rep(i,ind.size()) cout<<ind[i]+1<<" ";
    cout<<endl;
}

void outputCYC(vector<int> &cyc){
    cout<<2<<endl;
    cout<<cyc.size()<<endl;
    rep(i,cyc.size()) cout<<cyc[i]+1<<" ";
    cout<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin>>N>>M>>K;
  g.resize(N);
  rep(i,M){
    int a,b;
    cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vis.resize(N,0);
  cyc=false;
  goal=-1;

  dfs(0,-1,1);

  if(cycle.size()){
      int P=cycle.size();
      if(P>K){
          int l=0,r=P-1;
          vector<int> pos(N,-1);
          rep(i,P) pos[cycle[i]]=i;
          for(int i=0;i<P;i++){
              int now=cycle[i];
              if(i>r) break;
              for(auto nex:g[now]){
                  if(pos[nex]==-1) continue;
                  if(nex<l||nex>r){
                      pos[nex]=-1;
                      continue;
                  }
                  if(abs(i-pos[nex])<=1) continue;

                  if(pos[nex]<i){
                      r=i;
                      l=pos[nex];
                  }else{
                      l=i;
                      r=pos[nex];
                  }
              }
          }

          vector<int> sc;
          for(int i=l;i<=r;i++) sc.push_back(cycle[i]);

          if(sc.size()<=K) outputCYC(sc);
          else{
              vector<int> inds;
              rep(i,sc.size()) if(i%2==0) inds.push_back(sc[i]);
              outputIND(inds);
          }
      }else{
          outputCYC(cycle);
      }
  }else{
    if(inds.size()<(K+1)/2){
        inds.clear();
        rep(i,N) if(vis[i]==-1) inds.push_back(i);
    }
    outputIND(inds);
  }

  return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define speed                   \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define ll long long
#define pb push_back
#define endl "\n"
#define mod 1000000007
#define ff first
#define ss second
#define N 5000005
#define all(v) v.begin(), v.end()
#define sbit(a) __builtin_popcount(a)
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef pair<ll, ll> pll;
typedef pair<pll, ll> ppl;
typedef map<ll, ll> mpll;
typedef map<vector<ll>, ll> mpvl;
vector<ll>vis,par;
vector<vector<ll>> adj;
// vector<ll> ans;
ll color[100005];
// ll amin[1005][1005], tmp;
// ll sp[N][26], bp[N][20];
ll power(ll x, ll y, ll p)
{
  ll res = 1;

  x = x % p;

  if (x == 0)
    return 0;
  while (y > 0)
  {

    if (y & 1)
      res = (res * x) % p;

    y = y >> 1;
    x = (x * x) % p;
  }

  return res;
}
ll tmp=-1;
ll f=0;
ll ftmp=-1;
void bfs1(ll v)
{
    queue<ll> q;
    q.push(v);
    vis[v] = 1;
    color[v]=1;
    while (!q.empty())
    {
        ll u = q.front();
        q.pop();
        for (auto it : adj[u])
        {
            if (!vis[it])
            {
               par[it]=u;
                vis[it] = 1;
                q.push(it);
            }
            else
            {
              if(it!=par[u]&&f==0)
              {
                tmp=u;
                ftmp=it;
                f=1;
              }
            }

        }
    }
}
void bfs(ll v)
{
    queue<ll> q;
    q.push(v);
    vis[v] = 1;
    color[v]=1;
    while (!q.empty())
    {
        ll u = q.front();
        q.pop();
        for (auto it : adj[u])
        {
            if (!vis[it])
            {
               if(color[u]==1)
               {
                 color[it]=2;
               }
               else
               {
                 color[it]=1;
               }
                vis[it] = 1;
                q.push(it);
            }

        }
    }
}
void solve()
{
  ll n, m, k;
  cin >> n >> m >> k;

  adj.resize(n+1);

  vis.resize(n+1);
  par.resize(n+1);

  for(ll i=0;i<m;i++)
  {
    ll x,y;
    cin>>x>>y;
    adj[x].pb(y);
    adj[y].pb(x);
  }
  if(m==n-1)
  {
      fill(all(vis),0);
      bfs(1);
      ll cnt1=0,cnt2=0;
      for(ll i=1;i<=n;i++)
      {
        if(color[i]==1)
        cnt1++;
        else
        cnt2++;
      }
      cout<<1<<endl;
      ll c=0;
      ll tk=ceil((k*1.0)/2);
      for(ll i=1;i<=n;i++)
      {
        if(cnt1>=cnt2&&color[i]==1&&c<=tk)
        {
          cout<<i<<" ";
          c++;
        }
        else if(cnt2>cnt1&&color[i]==2&&c<=tk)
        {
          cout<<i<<" ";
          c++;
        }
      }
      cout<<endl;

  }
  else
  {
    par[1]=-1;
    fill(all(vis),0);
    bfs1(1);
    vector<ll>ans;
    ll cnt=0;
   // cout<<tmp;
   ll g=0;
  //  cerr<<tmp<<" "<<ftmp<<endl;
  //  cerr<<par[1]<<endl;
    for(ll i=tmp;i!=ftmp;i=par[i])
    {
        if(i==-1)
        {
          g=1;
          break;
        }
         ans.pb(i);
         cnt++;
    }
    if(!g)
    {
    ans.pb(ftmp);
    cnt++;
    }
    else
    {
      vector<ll>tans;
      for(ll i=ftmp;i!=1;i=par[i])
      {
        tans.pb(i);

        cnt++;
      }
      reverse(all(tans));
      for(auto it:tans)
      {
        ans.pb(it);
      }
    }
    // for(auto it:ans)
    // {
    //   cout<<it<<" ";
    // }
    // cout<<endl<<cnt<<endl;

   // cerr<<"ff";
    if(cnt<=k)
    {
      cout<<2<<endl;
      cout<<cnt<<endl;
      for(auto it:ans)
      {
        cout<<it<<" ";
      }
      cout<<endl;
    }
    else
    {
      ll i=0;

      cout<<1<<endl;
      ll tk=(k+1)/2;
     // cout<<tk<<" "<<"gg"<<endl;
      ll tc=0;
      for(auto it:ans)
      {

        if(i%2==0&&tc<tk)
        {
          cout<<it<<" ";
          tc++;
        }
        i++;
      }
      cout<<endl;
    }

  }
  adj.clear();
    par.clear();

}

int main()
{

  speed;
  ll kk;
   kk = 1;
  //cin >> kk;

  while (kk--)
  {

    solve();
  }
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define speed                   \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define ll long long
#define pb push_back
#define endl "\n"
#define mod 1000000007
#define ff first
#define ss second
#define N 5000005
#define all(v) v.begin(), v.end()
#define sbit(a) __builtin_popcount(a)
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef pair<ll, ll> pll;
typedef pair<pll, ll> ppl;
typedef map<ll, ll> mpll;
typedef map<vector<ll>, ll> mpvl;
vector<ll>vis,par;
vector<vector<ll>> adj;
// vector<ll> ans;
ll color[100005];
// ll amin[1005][1005], tmp;
// ll sp[N][26], bp[N][20];
ll power(ll x, ll y, ll p)
{
  ll res = 1;

  x = x % p;

  if (x == 0)
    return 0;
  while (y > 0)
  {

    if (y & 1)
      res = (res * x) % p;

    y = y >> 1;
    x = (x * x) % p;
  }

  return res;
}
ll tmp=-1;
ll f=0;
ll ftmp=-1;

ll dept[100005];
ll ans=1e18;
ll dfs(ll v)
{

    vis[v]=true;

    for(auto it:adj[v])
    {
        if(!vis[it])
        {
         par[it]=v;
         dept[it]=1+dept[v];
         dfs(it);

        }
        else
        {
          if(it!=par[v])
          {
            if(abs(dept[v]-dept[it])<ans)
            {
              ans=abs(dept[v]-dept[it]);
              tmp=v;
              ftmp=it;
            }
          }
        }

    }

}
void bfs(ll v)
{
    queue<ll> q;
    q.push(v);
    vis[v] = 1;
    color[v]=1;
    while (!q.empty())
    {
        ll u = q.front();
        q.pop();
        for (auto it : adj[u])
        {
            if (!vis[it])
            {
               if(color[u]==1)
               {
                 color[it]=2;
               }
               else
               {
                 color[it]=1;
               }
                vis[it] = 1;
                q.push(it);
            }

        }
    }
}
void solve()
{
  ll n, m, k;
  cin >> n >> m >> k;

  adj.resize(n+1);

  vis.resize(n+1);
  par.resize(n+1);

  for(ll i=0;i<m;i++)
  {
    ll x,y;
    cin>>x>>y;
    adj[x].pb(y);
    adj[y].pb(x);
  }
  if(m==n-1)
  {
      fill(all(vis),0);
      bfs(1);
      ll cnt1=0,cnt2=0;
      for(ll i=1;i<=n;i++)
      {
        if(color[i]==1)
        cnt1++;
        else
        cnt2++;
      }
      cout<<1<<endl;
      ll c=0;
      ll tk=ceil((k*1.0)/2);
      for(ll i=1;i<=n;i++)
      {
        if(cnt1>=cnt2&&color[i]==1&&c<tk)
        {
          cout<<i<<" ";
          c++;
        }
        else if(cnt2>cnt1&&color[i]==2&&c<tk)
        {
          cout<<i<<" ";
          c++;
        }
      }
      cout<<endl;

  }
  else
  {
    par[1]=-1;
    fill(all(vis),0);
    dept[1]=1;
    dfs(1);
    vector<ll>ans;
    ll cnt=0;
   // cout<<tmp;
   ll g=0;
  //  cerr<<tmp<<" "<<ftmp<<endl;
  //  cerr<<par[1]<<endl;
    for(ll i=tmp;i!=ftmp;i=par[i])
    {
        if(i==-1)
        {
          g=1;
          break;
        }
         ans.pb(i);
         cnt++;
    }
    if(!g)
    {
    ans.pb(ftmp);
    cnt++;
    }
    else
    {
      vector<ll>tans;
      for(ll i=ftmp;i!=1;i=par[i])
      {
        tans.pb(i);

        cnt++;
      }
      reverse(all(tans));
      for(auto it:tans)
      {
        ans.pb(it);
      }
    }
    // for(auto it:ans)
    // {
    //   cout<<it<<" ";
    // }
    // cout<<endl<<cnt<<endl;

   // cerr<<"ff";
    if(cnt<=k)
    {
      cout<<2<<endl;
      cout<<cnt<<endl;
      for(auto it:ans)
      {
        cout<<it<<" ";
      }
      cout<<endl;
    }
    else
    {
      ll i=0;

      cout<<1<<endl;
      ll tk=(k+1)/2;
     // cout<<tk<<" "<<"gg"<<endl;
      ll tc=0;
      for(auto it:ans)
      {

        if(i%2==0&&tc<tk)
        {
          cout<<it<<" ";
          tc++;
        }
        i++;
      }
      cout<<endl;
    }

  }
  adj.clear();
    par.clear();

}

int main()
{

  speed;
  ll kk;
   kk = 1;
  //cin >> kk;

  while (kk--)
  {

    solve();
  }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
ll n,k;
string s;
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	cout.flush();
	cin>>s;
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    SPEED;
    cin>>n>>k;
    ll l=1,r=n,ans=0;
    while(1){
    	if(ans>4500) {cout<<"dmm";return 0;}
    	ans++;
    	while(r-l>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,r)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    	}
    	ll t=rand()%(r-l+1)+l;
    	test(l,l);
    	l=max(1LL,l-k);r=min(n,r+k);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
ll n,k;
string s;
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	cout.flush();
	cin>>s;
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    SPEED;
    cin>>n>>k;
    ll l=1,r=n,ans=0;
    while(1){
    	if(ans>4500) {cout<<"dmm";return 0;}
    	ans++;
    	while(r-l>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    	}
    	ll t=rand()%(r-l+1)+l;
    	test(l,l);
    	l=max(1LL,l-k);r=min(n,r+k);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
ll n,k;
string s;
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	cout.flush();
	cin>>s;
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    SPEED;
    cin>>n>>k;
    ll l=1,r=n;
    while(1){
    	while(r-l>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    	}
    	ll t=rand()%(r-l+1)+l;
    	test(t,t);
    	l=max(1LL,l-k);r=min(n,r+k);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
mt19937 rands(chrono::steady_clock::now().time_since_epoch().count());
ll n,k;
char s[10];
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	scanf("%s", s);
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    scanf("%lld%lld",&n,&k);
    ll l=1,r=n,length=r-l+1;
    while(1){
    	while(length>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    		length=r-l+1;
    	}
    	ll t=rand()%length+l;
    	test(t,t);
    	if(s[0]=='B') exit(0);
    	l=max(1ll,l-k);r=min(n,r+k);
    	length=r-l+1;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
mt19937 rands(chrono::steady_clock::now().time_since_epoch().count());
ll n,k;
char s[10];
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	scanf("%s", s);
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    scanf("%lld%lld",&n,&k);
    ll l=1,r=n,length=r-l+1;
    while(1){
    	while(length>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    		length=r-l+1;
    	}
    	ll t=rand()%length+l;
    	test(t,t);
    	if(s[0]=='B') exit(0);
    	l=max(1ll,l-k);r=min(n,r+k);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
mt19937 rands(chrono::steady_clock::now().time_since_epoch().count());
ll n,k;
char s[10];
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	scanf("%s", s);
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    srand(2645464679);
    scanf("%lld%lld",&n,&k);
    ll l=1,r=n,length=r-l+1;
    while(1){
    	while(length>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    		length=r-l+1;
    	}
    	ll t=rand()%length+l;
    	test(t,t);
    	if(s[0]=='B') exit(0);
    	l=max(1ll,l-k);r=min(n,r+k);
    	length=r-l+1;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
mt19937 rands(chrono::steady_clock::now().time_since_epoch().count());
ll n,k;
char s[10];
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	scanf("%s", s);
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    scanf("%lld%lld",&n,&k);
    ll l=1,r=n,length=r-l+1;
    while(1){
    	while(length>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    		length=r-l+1;
    	}
    	ll t=rands()%length+l;
    	test(t,t);
    	if(s[0]=='B') exit(0);
    	l=max(1ll,l-k);r=min(n,r+k);
    	length=r-l+1;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll n,k;
char s[10];
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	scanf("%s", s);
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    scanf("%lld%lld",&n,&k);
    ll l=1,r=n,length=r-l+1;
    while(1){
    	while(length>5*k){
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    	}
    	ll t=rng()%length+l;
    	test(t,t);
    	if(s[0]=='B') exit(0);
    	l=max(1ll,l-k);r=min(n,r+k);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a-1;i>=b;i--)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define ii pair<int,int>
#define iii pair<int,ii>
#define pb push_back
#define mp make_pair
mt19937 rands(chrono::steady_clock::now().time_since_epoch().count());
ll n,k;
char s[10];
bool test(ll l,ll r){
	cout<<l<<" "<<r<<endl;
	fflush(stdout);
	scanf("%s", s);
	if (s[0]=='Y' && l==r) exit(0);
	return s[0]=='Y';
}
int main(){
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    scanf("%lld%lld",&n,&k);
    ll l=1,r=n,length=r-l+1;
    while(1){
    	if(length<=5*k){
    		ll t=rand()%length+l;
    		test(t,t);
    		if(s[0]=='B') exit(0);
    		l=max(1ll,l-k);r=min(n,r+k);
    	}
    		ll m=(l+r)>>1;
    		if(test(l,m)) r=m;
    		else l=m+1;
    		l=max(1LL,l-k);r=min(n,r+k);
    }
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+2+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=4*k+2)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(int i=1;i<=100000;i++)
    v.push_back(1000000000000000000LL-1LL+i*1LL);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    int id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=100000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;
  long lo=1,hi=n;
  while(true)
  {
    long id=-1;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=v[++id]%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      string s;cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    string s;
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=max(hi-lo,1LL);
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    //if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      //if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  //ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=100000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=0;ml--;
    if(hi-lo<=3*k)
    {
      long dff=max(hi-lo,1LL);
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  //ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=1000000;i++)
    v.push_back(1000000000000000000LL-1LL+i*1LL);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=0;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo;
      //long rn=((rand()%dff)*ml)%dff;
      long rn=(v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=5000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;string s;
  long lo=1,hi=n;
  while(true)
  {
    long id=-1;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=(v[++id]*v[id+1])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=4*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  //ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=100000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=0;ml--;
    if(hi-lo<=3*k)
    {
      long dff=max(hi-lo,1LL);
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=5000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;string s;
  long lo=1,hi=n;
  int t=clock();
  while(true)
  {
    long id=-1;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=(v[++id]*t)%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+2+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;
  long lo=1,hi=n;
  while(true)
  {
    long id=-1;ml--;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<"\n";
      fflush(stdout);
      string s;cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<"\n";
    fflush(stdout);
    string s;
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+2+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;
  long lo=1,hi=n;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=4*k+2)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      string s;cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    string s;
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+2+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=4*k+2)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=max(hi-lo,1LL);
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<max(lo+rn,n)<<" "<<max(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=3*k+2)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=5000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;string s;
  long lo=1,hi=n;
  while(true)
  {
    long t=rand();
    long id=-1;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=(((((t*t)%dff)*t)%dff)*t)%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  //ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=1000000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=0;ml--;
    if(hi-lo<=3*k)
    {
      long dff=max(hi-lo,1LL);
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=5*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    //if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      //if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=5000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;string s;
  long lo=1,hi=n;
  while(true)
  {
    long t=rand();
    long id=-1;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=(v[++id]*t)%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
//    if(hi-lo<=3*k)
//    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    //}
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    //string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=5000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;string s;
  long lo=1,hi=n;
  while(true)
  {
    long t=clock();
    long id=-1;
    long dff=hi-lo+1;
    long rn=(v[++id]*t)%dff;
    cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")exit(0);
    else
    {
      lo=max(1LL,lo-k);
      hi=min(n,hi+k);
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  //ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=100000;i++)
    v.push_back(1000000000000000000LL-1LL+i*1LL);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+2+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;
  long lo=1,hi=n;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      string s;cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    string s;
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=5000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;string s;
  long lo=1,hi=n;
  while(true)
  {
    long t=clock();
    long id=-1;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=(v[++id]*t)%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=5000;i++)
    v.push_back(i);
  random_shuffle(v.begin(),v.end());
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;string s;
  long lo=1,hi=n;
  while(true)
  {
    long id=-1;
    if(hi-lo<=4*k+5)
    {
      long dff=hi-lo+1;
      long rn=v[++id]%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);
      cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
//    if(hi-lo<=3*k)
//    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    //}
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=max(hi-lo,1LL);
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=4*k+2)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(int i=1;i<=100000;i++)
    v.push_back(1000000000000000000LL+i*1LL);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;
  long lo=1,hi=n;
  while(true)
  {
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);
    string s;cin>>s;
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    int id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);
      string s;cin>>s;
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=5*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    //string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
//    if(hi-lo<=3*k)
//    {
      long t=clock();
      long dff=hi-lo+1;
      long rn=(v[++id]*t)%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    //}
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    //string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      //if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    //if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=5*k)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL-1LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    long id=-1;ml--;
//    if(hi-lo<=3*k)
//    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    //}
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    //string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  //ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=1000000;i++)
    v.push_back(1000000000000000000LL-1LL+i*1LL);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4498)cout<<lo<<" "<<lo<<endl,exit(0);
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    long id=0;ml--;
    if(hi-lo<=3*k)
    {
      long dff=hi-lo;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      cout<<lo+rn<<" "<<lo+rn<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define long long long
using namespace std;
long ml=1e9+7;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  vector<long>v;
  for(long i=1;i<=10000;i++)
    v.push_back(1000000LL+i);
  random_shuffle(v.begin(),v.end());
  long n,k;cin>>n>>k;k=10;
  long lo=1,hi=n,cnt=0;
  while(true)
  {
    //if(cnt>=4499)cout<<lo<<" "<<lo<<endl,exit(0);
    long id=-1;ml--;
    if(hi-lo<=4*k+1)
    {
      long dff=hi-lo+1;
      long rn=((rand()%dff)*ml)%dff;
      rn=(rn+v[++id])%dff;
      //if(cnt%45==0)rn=0;
      cout<<min(lo+rn,n)<<" "<<min(lo+rn,n)<<endl;
      fflush(stdout);cnt++;
      string s;cin>>s;
      if(s=="Bad")exit(0);
      if(s=="Yes")exit(0);
      else
      {
        lo=max(1LL,lo-k);
        hi=min(n,hi+k);
      }
    }
    long md=(lo+hi)/2;
    cout<<lo<<" "<<md<<endl;
    fflush(stdout);cnt++;
    string s;
    cin>>s;
    if(s=="Bad")exit(0);
    if(s=="Yes")
    {
      lo=max(1LL,lo-k);
      hi=min(n,md+k);
    }
    else
    {
      lo=max(1LL,md-k);
      hi=min(n,hi+k);
    }
    //cout<<lo<<"***"<<hi<<endl;
  }
  return 0;
}


# pragma GCC optimize ("O0")
//# pragma GCC optimize ("O3")
//# pragma GCC optimize ("Ofast")
//# pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define UN -1
#define VIS -2
#define EX -3
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define pob pop_back()
#define puf push_front
#define pof pop_front()
#define clr(a) (a).clear()
#define sz(a) (int)(a).size()
#define forn(t, n) for(int t = 0; t < n; t++)
#define foren(t, n) for(int t = 1; t <= n; t++)
#define llm LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define intm INT_MAX
#define intmn INT_MIN
#define dblm DBL_MAX
#define dblmn DBL_MIN
#define mod 1000000007
#define mod2 1000000009
#define mil 1111111
#define bil 1111111111
#define pi M_PI
#define euler 2.718281828459
#define eps 1e-12
#define degrad (pi/180.0)
#define raddeg (180.0/pi)
#define uset unordered_set
#define umap unordered_map
#define DBG(x) cout << #x << ": " << x << "\n";
#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi;
typedef pair<int, ii> iii; typedef pair<ii, ii> iiii; typedef pair<ll, pll> tll;
typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<char> vc; typedef vector<vc> vvc;
typedef vector<bool> vb; typedef vector<vb> vvb; typedef queue<int> qi; typedef queue<ll> qll;
typedef queue<ii> qii; typedef vector<tll> vtll; typedef vector<iii> viii; typedef pair<pll, pll> ppll;
typedef priority_queue<int> pqi; typedef priority_queue<ll> pqll;
typedef pair<int, ii> iii; typedef vector<iii> viii; typedef vector<string> vs;
typedef vector<double> vd; typedef pair<double, double> dd; typedef vector<dd> vdd; typedef pair<ii, int> riii;
typedef vector<vector<double> > vvd; typedef vector<vvi> vvvi;

template<class T> void pv(vector<T> &vec) { forn(i, sz(vec)) cout << vec[i] << (i == sz(vec) - 1 ? '\n' : ' '); }

//ifstream in("/home/danza/CLionProjects/codeforces/in.in");
//ofstream out("/home/danza/CLionProjects/codeforces/out.out");
//#define cin in
//#define cout out

int main() { fio
    ll n, k;
    cin >> n >> k;
    ll l = 1LL, r = n + 1LL, mid;
    string s;
    srand(time(0));
    int cnt = 0;
    while(true) {
        mid = (l + r) / 2LL;
        bool guess = l == mid;
        if(r - l < 2 * k + 3LL) {
            ll t = l + ((ll)(rand()) % (2 * k + 3LL));
            t = min(t, n);
            t = max(1LL, t);
            cout << t << ' ' << t << endl;
            guess = true;
        }
        else {
            cout << l << ' ' << mid << endl;
        }
        cin >> s;
        if(s == "Bad") {
            //forn(i, intm - 1)
            //    int x = 2;
            return 0;
        }
        if(s == "Yes") {
            if(guess)
                return 0;
            l = max(1LL, l - k);
            r = min(n, mid + k);
        }
        else {
            if(guess) {
                l = max(1LL, l - k);
                r = min(n, r + k);
            }
            else {
                l = max(1LL, l - k);
                r = min(n, r + k);
            }
        }
        cnt++;
        if(cnt > 4490)
            forn(i, intm - 1)
                int x = 23;
    }

    return 0;
}


# pragma GCC optimize ("O0")
//# pragma GCC optimize ("O3")
//# pragma GCC optimize ("Ofast")
//# pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define UN -1
#define VIS -2
#define EX -3
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define pob pop_back()
#define puf push_front
#define pof pop_front()
#define clr(a) (a).clear()
#define sz(a) (int)(a).size()
#define forn(t, n) for(int t = 0; t < n; t++)
#define foren(t, n) for(int t = 1; t <= n; t++)
#define llm LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define intm INT_MAX
#define intmn INT_MIN
#define dblm DBL_MAX
#define dblmn DBL_MIN
#define mod 1000000007
#define mod2 1000000009
#define mil 1111111
#define bil 1111111111
#define pi M_PI
#define euler 2.718281828459
#define eps 1e-12
#define degrad (pi/180.0)
#define raddeg (180.0/pi)
#define uset unordered_set
#define umap unordered_map
#define DBG(x) cout << #x << ": " << x << "\n";
#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi;
typedef pair<int, ii> iii; typedef pair<ii, ii> iiii; typedef pair<ll, pll> tll;
typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<char> vc; typedef vector<vc> vvc;
typedef vector<bool> vb; typedef vector<vb> vvb; typedef queue<int> qi; typedef queue<ll> qll;
typedef queue<ii> qii; typedef vector<tll> vtll; typedef vector<iii> viii; typedef pair<pll, pll> ppll;
typedef priority_queue<int> pqi; typedef priority_queue<ll> pqll;
typedef pair<int, ii> iii; typedef vector<iii> viii; typedef vector<string> vs;
typedef vector<double> vd; typedef pair<double, double> dd; typedef vector<dd> vdd; typedef pair<ii, int> riii;
typedef vector<vector<double> > vvd; typedef vector<vvi> vvvi;

template<class T> void pv(vector<T> &vec) { forn(i, sz(vec)) cout << vec[i] << (i == sz(vec) - 1 ? '\n' : ' '); }

//ifstream in("/home/danza/CLionProjects/codeforces/in.in");
//ofstream out("/home/danza/CLionProjects/codeforces/out.out");
//#define cin in
//#define cout out

int main() { fio
    ll n, k;
    cin >> n >> k;
    ll l = 1, r = n + 1, mid;
    string s;
    srand(time(0));
    while(true) {
        mid = (l + r) / 2LL;
        bool guess = l == mid;
        if(r - l < k + 3LL) {
            ll t = l + ((ll)(rand()) % (r - l + 1LL));
            t = min(t, n);
            t = max(1LL, t);
            //if(t < 1LL || t > n) {
            //    forn(i, intm - 1)
            //        int x = 234;
            //}
            cout << t << ' ' << t << endl;
            guess = true;
        }
        else {
//            if(l < 1LL || l > n || mid < 1LL || mid > n)
//                forn(i, intm - 1)
//                    int x = 234;
            cout << l << ' ' << mid << endl;
        }
        cin >> s;
        if(s == "Bad") {
            //forn(i, intm - 1)
            //    int x = 2;
            return 0;
        }
        if(s == "Yes") {
            if(guess)
                return 0;
            l = max(1LL, l - k);
            r = min(n, mid + k);
        }
        else {
            l = max(1LL, l - 2 * k - 1);
            r = min(n, r + 2 * k + 1);
        }
    }

    return 0;
}


# pragma GCC optimize ("O0")
//# pragma GCC optimize ("O3")
//# pragma GCC optimize ("Ofast")
//# pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define UN -1
#define VIS -2
#define EX -3
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define pob pop_back()
#define puf push_front
#define pof pop_front()
#define clr(a) (a).clear()
#define sz(a) (int)(a).size()
#define forn(t, n) for(int t = 0; t < n; t++)
#define foren(t, n) for(int t = 1; t <= n; t++)
#define llm LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define intm INT_MAX
#define intmn INT_MIN
#define dblm DBL_MAX
#define dblmn DBL_MIN
#define mod 1000000007
#define mod2 1000000009
#define mil 1111111
#define bil 1111111111
#define pi M_PI
#define euler 2.718281828459
#define eps 1e-12
#define degrad (pi/180.0)
#define raddeg (180.0/pi)
#define uset unordered_set
#define umap unordered_map
#define DBG(x) cout << #x << ": " << x << "\n";
#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi;
typedef pair<int, ii> iii; typedef pair<ii, ii> iiii; typedef pair<ll, pll> tll;
typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<char> vc; typedef vector<vc> vvc;
typedef vector<bool> vb; typedef vector<vb> vvb; typedef queue<int> qi; typedef queue<ll> qll;
typedef queue<ii> qii; typedef vector<tll> vtll; typedef vector<iii> viii; typedef pair<pll, pll> ppll;
typedef priority_queue<int> pqi; typedef priority_queue<ll> pqll;
typedef pair<int, ii> iii; typedef vector<iii> viii; typedef vector<string> vs;
typedef vector<double> vd; typedef pair<double, double> dd; typedef vector<dd> vdd; typedef pair<ii, int> riii;
typedef vector<vector<double> > vvd; typedef vector<vvi> vvvi;

template<class T> void pv(vector<T> &vec) { forn(i, sz(vec)) cout << vec[i] << (i == sz(vec) - 1 ? '\n' : ' '); }

//ifstream in("/home/danza/CLionProjects/codeforces/in.in");
//ofstream out("/home/danza/CLionProjects/codeforces/out.out");
//#define cin in
//#define cout out

int main() { fio
    ll n, k;
    cin >> n >> k;
    ll l = 1, r = n + 1, mid;
    string s;
    srand(time(0));
    int cnt = 0;
    while(true) {
        mid = (l + r) / 2LL;
        bool guess = l == mid;
        if(r - l < 2 * k + 3LL) {
            ll t = l + ((ll)(rand()) % (2LL * k + 3LL));
            t = min(t, n);
            t = max(1LL, t);
            //if(t < 1LL || t > n) {
            //    forn(i, intm - 1)
            //        int x = 234;
            //}
            cout << t << ' ' << t << endl;
            guess = true;
        }
        else {
//            if(l < 1LL || l > n || mid < 1LL || mid > n)
//                forn(i, intm - 1)
//                    int x = 234;
            cout << l << ' ' << mid << endl;
        }
        cin >> s;
        if(s == "Bad") {
            //forn(i, intm - 1)
            //    int x = 2;
            return 0;
        }
        if(s == "Yes") {
            if(guess)
                return 0;
            l = max(1LL, l - k);
            r = min(n, mid + k);
        }
        else {
            l = max(1LL, l - 2 * k - 1);
            r = min(n, r + 2 * k + 1);
        }
        cnt++;
        if(cnt > 4490)
            forn(i, intm - 1)
                int x = 23;
    }

    return 0;
}


# pragma GCC optimize ("O0")
//# pragma GCC optimize ("O3")
//# pragma GCC optimize ("Ofast")
//# pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define UN -1
#define VIS -2
#define EX -3
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define pob pop_back()
#define puf push_front
#define pof pop_front()
#define clr(a) (a).clear()
#define sz(a) (int)(a).size()
#define forn(t, n) for(int t = 0; t < n; t++)
#define foren(t, n) for(int t = 1; t <= n; t++)
#define llm LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define intm INT_MAX
#define intmn INT_MIN
#define dblm DBL_MAX
#define dblmn DBL_MIN
#define mod 1000000007
#define mod2 1000000009
#define mil 1111111
#define bil 1111111111
#define pi M_PI
#define euler 2.718281828459
#define eps 1e-12
#define degrad (pi/180.0)
#define raddeg (180.0/pi)
#define uset unordered_set
#define umap unordered_map
#define DBG(x) cout << #x << ": " << x << "\n";
#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi;
typedef pair<int, ii> iii; typedef pair<ii, ii> iiii; typedef pair<ll, pll> tll;
typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<char> vc; typedef vector<vc> vvc;
typedef vector<bool> vb; typedef vector<vb> vvb; typedef queue<int> qi; typedef queue<ll> qll;
typedef queue<ii> qii; typedef vector<tll> vtll; typedef vector<iii> viii; typedef pair<pll, pll> ppll;
typedef priority_queue<int> pqi; typedef priority_queue<ll> pqll;
typedef pair<int, ii> iii; typedef vector<iii> viii; typedef vector<string> vs;
typedef vector<double> vd; typedef pair<double, double> dd; typedef vector<dd> vdd; typedef pair<ii, int> riii;
typedef vector<vector<double> > vvd; typedef vector<vvi> vvvi;

template<class T> void pv(vector<T> &vec) { forn(i, sz(vec)) cout << vec[i] << (i == sz(vec) - 1 ? '\n' : ' '); }

//ifstream in("/home/danza/CLionProjects/codeforces/in.in");
//ofstream out("/home/danza/CLionProjects/codeforces/out.out");
//#define cin in
//#define cout out

int main() { fio
    ll n, k;
    cin >> n >> k;
    ll l = 1LL, r = n + 1LL, mid;
    string s;
    srand(time(0));
    while(true) {
        mid = (l + r) / 2LL;
        bool guess = false;
        if(r - l < 50) {
            ll t = l + ((ll)(rand()) % (r - l + 1));
            t = min(t, n);
            t = max(1LL, t);
            cout << t << ' ' << t << endl;
            guess = true;
        }
        else {
            cout << l << ' ' << mid << endl;
        }
        cin >> s;
        if(s == "Bad") {
            return 0;
        }
        if(s == "Yes") {
            if(guess)
                return 0;
            l = max(1LL, l - k);
            r = min(n, mid + k);
        }
        else {
            if(guess) {
                l = max(1LL, l - k - 1);
                r = min(n, r + k + 1);
            }
            else {
                l = max(1LL, l - k - 1);
                r = mid;
                r = min(n, r + k + 1);
            }
        }
    }

    return 0;
}


# pragma GCC optimize ("O0")
//# pragma GCC optimize ("O3")
//# pragma GCC optimize ("Ofast")
//# pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define UN -1
#define VIS -2
#define EX -3
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define pob pop_back()
#define puf push_front
#define pof pop_front()
#define clr(a) (a).clear()
#define sz(a) (int)(a).size()
#define forn(t, n) for(int t = 0; t < n; t++)
#define foren(t, n) for(int t = 1; t <= n; t++)
#define llm LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define intm INT_MAX
#define intmn INT_MIN
#define dblm DBL_MAX
#define dblmn DBL_MIN
#define mod 1000000007
#define mod2 1000000009
#define mil 1111111
#define bil 1111111111
#define pi M_PI
#define euler 2.718281828459
#define eps 1e-12
#define degrad (pi/180.0)
#define raddeg (180.0/pi)
#define uset unordered_set
#define umap unordered_map
#define DBG(x) cout << #x << ": " << x << "\n";
#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi;
typedef pair<int, ii> iii; typedef pair<ii, ii> iiii; typedef pair<ll, pll> tll;
typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<char> vc; typedef vector<vc> vvc;
typedef vector<bool> vb; typedef vector<vb> vvb; typedef queue<int> qi; typedef queue<ll> qll;
typedef queue<ii> qii; typedef vector<tll> vtll; typedef vector<iii> viii; typedef pair<pll, pll> ppll;
typedef priority_queue<int> pqi; typedef priority_queue<ll> pqll;
typedef pair<int, ii> iii; typedef vector<iii> viii; typedef vector<string> vs;
typedef vector<double> vd; typedef pair<double, double> dd; typedef vector<dd> vdd; typedef pair<ii, int> riii;
typedef vector<vector<double> > vvd; typedef vector<vvi> vvvi;

template<class T> void pv(vector<T> &vec) { forn(i, sz(vec)) cout << vec[i] << (i == sz(vec) - 1 ? '\n' : ' '); }

//ifstream in("/home/danza/CLionProjects/codeforces/in.in");
//ofstream out("/home/danza/CLionProjects/codeforces/out.out");
//#define cin in
//#define cout out

int main() { fio
    ll n, k;
    cin >> n >> k;
    ll l = 1, r = n + 1, mid;
    string s;
    srand(time(0));
    int cnt = 0;
    while(true) {
        mid = (l + r) / 2LL;
        bool guess = l == mid;
        if(r - l < 4 * k + 3LL) {
            ll t = l + ((ll)(rand()) % (4 * k + 3LL));
            t = min(t, n);
            t = max(1LL, t);
            cout << t << ' ' << t << endl;
            guess = true;
        }
        else {
            cout << l << ' ' << mid << endl;
        }
        cin >> s;
        if(s == "Bad") {
            //forn(i, intm - 1)
            //    int x = 2;
            return 0;
        }
        if(s == "Yes") {
            if(guess)
                return 0;
            l = max(1LL, l - k);
            r = min(n, mid + k);
        }
        else {
            l = max(1LL, l - 2 * k - 1);
            r = min(n, r + 2 * k + 1);
        }
        cnt++;
        if(cnt > 4490)
            forn(i, intm - 1)
                int x = 23;
    }

    return 0;
}


# pragma GCC optimize ("O0")
//# pragma GCC optimize ("O3")
//# pragma GCC optimize ("Ofast")
//# pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define UN -1
#define VIS -2
#define EX -3
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define pob pop_back()
#define puf push_front
#define pof pop_front()
#define clr(a) (a).clear()
#define sz(a) (int)(a).size()
#define forn(t, n) for(int t = 0; t < n; t++)
#define foren(t, n) for(int t = 1; t <= n; t++)
#define llm LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define intm INT_MAX
#define intmn INT_MIN
#define dblm DBL_MAX
#define dblmn DBL_MIN
#define mod 1000000007
#define mod2 1000000009
#define mil 1111111
#define bil 1111111111
#define pi M_PI
#define euler 2.718281828459
#define eps 1e-12
#define degrad (pi/180.0)
#define raddeg (180.0/pi)
#define uset unordered_set
#define umap unordered_map
#define DBG(x) cout << #x << ": " << x << "\n";
#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi;
typedef pair<int, ii> iii; typedef pair<ii, ii> iiii; typedef pair<ll, pll> tll;
typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<char> vc; typedef vector<vc> vvc;
typedef vector<bool> vb; typedef vector<vb> vvb; typedef queue<int> qi; typedef queue<ll> qll;
typedef queue<ii> qii; typedef vector<tll> vtll; typedef vector<iii> viii; typedef pair<pll, pll> ppll;
typedef priority_queue<int> pqi; typedef priority_queue<ll> pqll;
typedef pair<int, ii> iii; typedef vector<iii> viii; typedef vector<string> vs;
typedef vector<double> vd; typedef pair<double, double> dd; typedef vector<dd> vdd; typedef pair<ii, int> riii;
typedef vector<vector<double> > vvd; typedef vector<vvi> vvvi;

template<class T> void pv(vector<T> &vec) { forn(i, sz(vec)) cout << vec[i] << (i == sz(vec) - 1 ? '\n' : ' '); }

//ifstream in("/home/danza/CLionProjects/codeforces/in.in");
//ofstream out("/home/danza/CLionProjects/codeforces/out.out");
//#define cin in
//#define cout out

int main() { fio
    ll n, k;
    cin >> n >> k;
    ll l = 1, r = n, mid;
    string s;
    srand(time(0));
    while(l < r) {
        mid = (l + r) / 2LL;
        bool guess = l == mid;
        if(r - l < 2 * k + 3) {
            int t = rand() % (2 * k + 3) + 1;
            cout << t << ' ' << t << endl;
            guess = true;
        }
        else {
            cout << l << ' ' << mid << endl;
        }
        cin >> s;
        if(s == "Bad")
            return 0;
        if(s == "Yes") {
            if(guess)
                return 0;
            l = max(1LL, l - k);
            r = min(n, mid + k);
        }
        else {
            l = max(1LL, l - 2 * k - 1);
            r = min(n, r + 2 * k + 1);
        }
    }

    return 0;
}