#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 1000;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];
int fir[N], sec[N];
int ord[N], fa[N];
int T = 0;

void dfs(int v, int p){
    for(int nxt : G[v]) if(nxt != p) dfs(nxt, v);
    fa[v] = p;
    ord[T++] = v;
}

//int get_res(int x, int v, int p){
//    int com = 0;
//    int mx1 = 0, mx2 = 0;
//    for(int nxt : G[v]){
//        if(nxt == p) continue;
//        get_res(x, nxt, v);
//        com += fir[nxt];
//        if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
//        else if(sec[nxt] > mx2) mx2 = sec[nxt];
//    }
//    if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
//    else fir[v] = com, sec[v] = mx1 + 1;
//    return fir[v];
//}

int get_res(int x){
    for(int i = 0; i < n; i++){
        int v = ord[i];
        int com = 0, mx1 = 0, mx2 = 0;
        for(int nxt : G[v]){
            if(nxt == fa[v]) continue;
            com += fir[nxt];
            if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
            else if(sec[nxt] > mx2) mx2 = sec[nxt];
        }
        if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
        else fir[v] = com, sec[v] = mx1 + 1;
    }
    return fir[ord[n-1]];
}

int get(int x){
    if(res[x] != -1) return res[x];
    else return res[x] = get_res(x);
}

void solve(int l, int r){
    if(l > r) return ;
    int x = get(l), y = get(r);
    if(l + 1 == r || x == y){
        for(int j = l + 1; j < r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l, mid), solve(mid, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1, 0);
    fill(res, res + n + 1, -1);
    for(int i = 1; i <= min(SQRT, n); i++){
        res[i] = get(i);
    }

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 250, BKSIZE = 405;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

P get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt != p){
            P p = get_res(x, nxt, v);
            com += p.first;
            if(p.second > mx1) mx2 = mx1, mx1 = p.second;
            else if(p.second > mx2) mx2 = p.second;
        }
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

int get_upp(int ans){
    int l = 1, r = n + 1, mid;
    while(l + 1 < r){
        mid = (l + r) / 2;
        if(get_res(mid, 0, -1).first >= ans) l = mid;
        else r = mid;
    }
    return l;
}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int k = 1; k <= min(BKSIZE, n); k++){
        res[k] = get_res(k, 0, -1).first;
    }
    upp[0] = n;
    for(int i = 1; i <= BK; i++) upp[i] = get_upp(i);
//    for(int i = 1; i <=n; i++) cout << upp[i] << " ";
//    cout << endl;

    int cur = BK;
    for(int i = BKSIZE + 1; i <= n; i++){
        while(upp[cur] < i) cur--;
        res[i] = cur;
    }

    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);

}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 80;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];
int fir[N], sec[N];
int ord[N], fa[N];
int T = 0;

void dfs(int v, int p){
    for(int nxt : G[v]) if(nxt != p) dfs(nxt, v);
    fa[v] = p;
    ord[T++] = v;
}

//int get_res(int x, int v, int p){
//    int com = 0;
//    int mx1 = 0, mx2 = 0;
//    for(int nxt : G[v]){
//        if(nxt == p) continue;
//        get_res(x, nxt, v);
//        com += fir[nxt];
//        if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
//        else if(sec[nxt] > mx2) mx2 = sec[nxt];
//    }
//    if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
//    else fir[v] = com, sec[v] = mx1 + 1;
//    return fir[v];
//}

int get_res(int x){
    for(int i = 0; i < n; i++){
        int v = ord[i];
        int com = 0, mx1 = 0, mx2 = 0;
        for(int nxt : G[v]){
            if(nxt == fa[v]) continue;
            com += fir[nxt];
            if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
            else if(sec[nxt] > mx2) mx2 = sec[nxt];
        }
        if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
        else fir[v] = com, sec[v] = mx1 + 1;
    }
    return fir[ord[n-1]];
}

int get(int x){
    if(res[x] != -1) return res[x];
    else return res[x] = get_res(x);
}

void solve(int l, int r){
    if(l > r) return ;
    int x = get(l), y = get(r);
    if(l + 1 == r || x == y){
        for(int j = l + 1; j < r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l, mid), solve(mid, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1, 0);
    fill(res, res + n + 1, -1);
    for(int i = 1; i <= min(SQRT, n); i++){
        res[i] = get(i);
    }

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

void elim(int v, int p){
    vector<int> newG;
    for(int nxt : G[v]){
        if(nxt != p) newG.push_back(nxt);
    }
    G[v] = newG;
    newG.clear();
    for(int nxt : G[v]) elim(nxt, v);

}

P get_res(int x, int v){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        P p = get_res(x, nxt);
        com += p.first;
        if(p.second > mx1) mx2 = mx1, mx1 = p.second;
        else if(p.second > mx2) mx2 = p.second;
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

int get_upp(int ans, int las){
    int l = 1, r = las + 1, mid;
    while(l + 1 < r){
        mid = (l + r) / 2;
        if(get_res(mid, 1).first >= ans) l = mid;
        else r = mid;
    }
    return l;
}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    elim(1, -1);
    for(int k = 1; k <= min(BKSIZE, n); k++){
        res[k] = get_res(k, 1).first;
    }
    upp[0] = n;
    for(int i = 1; i <= BK; i++) upp[i] = get_upp(i, upp[i-1]);
//    for(int i = 1; i <=n; i++) cout << upp[i] << " ";
//    cout << endl;

    int cur = BK;
    for(int i = BKSIZE + 1; i <= n; i++){
        while(upp[cur] < i) cur--;
        res[i] = cur;
    }

    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);

}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 1000;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];
int fir[N], sec[N];

int get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt == p) continue;
        get_res(x, nxt, v);
        com += fir[nxt];
        if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
        else if(sec[nxt] > mx2) mx2 = sec[nxt];
    }
    if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
    else fir[v] = com, sec[v] = mx1 + 1;
    return fir[v];
}

void solve(int l, int r){
    if(l > r) return ;
    if(l == r){
        res[l] = get_res(l, 1, 0);
        return ;
    }
    int x = get_res(l, 1, 0), y = get_res(r, 1, 0);

    if(x == y){
        for(int j = l; j <= r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l + 1, mid), solve(mid + 1, r - 1);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int i = 1; i <= min(SQRT, n); i++){
        res[i] = get_res(i, 1, 0);
    }

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];
int fir[N], sec[N];
int ord[N], fa[N];
int T = 0;

void dfs(int v, int p){
    for(int nxt : G[v]) if(nxt != p) dfs(nxt, v);
    fa[v] = p;
    ord[T++] = v;
}

int get_res(int x){
    for(int i = 0; i < n; i++){
        int v = ord[i];
        int com = 0, mx1 = 0, mx2 = 0;
        for(int nxt : G[v]){
            if(nxt == fa[v]) continue;
            com += fir[nxt];
            if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
            else if(sec[nxt] > mx2) mx2 = sec[nxt];
        }
        if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
        else fir[v] = com, sec[v] = mx1 + 1;
    }
    return fir[ord[n-1]];
}

int get_upp(int ans, int las){
    int l = 1, r = las + 1, mid;
    while(l + 1 < r){
        mid = (l + r) / 2;
        if(get_res(mid) >= ans) l = mid;
        else r = mid;
    }
    return l;
}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1, 0);
    fill(res, res + n + 1, -1);
    for(int k = 1; k <= min(BKSIZE, n); k++){
        res[k] = get_res(k);
    }
    upp[0] = n;
    for(int i = 1; i <= BK; i++) upp[i] = get_upp(i, upp[i-1]);
//    for(int i = 1; i <=n; i++) cout << upp[i] << " ";
//    cout << endl;

    int cur = BK;
    for(int i = BKSIZE + 1; i <= n; i++){
        while(upp[cur] < i) cur--;
        res[i] = cur;
    }

    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);

}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 80, BKSIZE = 1255;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

P get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt != p){
            P p = get_res(x, nxt, v);
            com += p.first;
            if(p.second > mx1) mx2 = mx1, mx1 = p.second;
            else if(p.second > mx2) mx2 = p.second;
        }
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

int get_upp(int ans){
    int l = 1, r = n + 1, mid;
    while(l + 1 < r){
        mid = (l + r) / 2;
        if(get_res(mid, 0, -1).first >= ans) l = mid;
        else r = mid;
    }
    return l;
}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int k = 1; k <= min(BKSIZE, n); k++){
        res[k] = get_res(k, 0, -1).first;
    }
    upp[0] = n;
    for(int i = 1; i <= BK; i++) upp[i] = get_upp(i);
//    for(int i = 1; i <=n; i++) cout << upp[i] << " ";
//    cout << endl;

    int cur = BK;
    for(int i = BKSIZE + 1; i <= n; i++){
        while(upp[cur] < i) cur--;
        res[i] = cur;
    }

    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);

}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

P get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt == p) continue;
        P p = get_res(x, nxt, v);
        com += p.first;
        if(p.second > mx1) mx2 = mx1, mx1 = p.second;
        else if(p.second > mx2) mx2 = p.second;
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

void solve(int l, int r){
    int x;
    if((x = get_res(l, 1, 0).first) == get_res(r, 1, 0).first){
        for(int j = l; j <= r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l, mid), solve(mid + 1, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int i = 1; i <= min(SQRT, n); i++) res[i] = get_res(i, 1, 0).first;

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 1000;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];
int fir[N], sec[N];

int get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt == p) continue;
        get_res(x, nxt, v);
        com += fir[nxt];
        if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
        else if(sec[nxt] > mx2) mx2 = sec[nxt];
    }
    if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
    else fir[v] = com, sec[v] = mx1 + 1;
    return fir[v];
}

void solve(int l, int r){
    if(l > r) return ;
    if(l == r){
        res[l] = get_res(l, 1, 0);
        return ;
    }
    int x = get_res(l, 1, 0), y = get_res(r, 1, 0);
    res[l] = x; res[r] = y;

    if(x == y){
        for(int j = l; j <= r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l + 1, mid), solve(mid + 1, r - 1);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int i = 1; i <= min(SQRT, n); i++){
        res[i] = get_res(i, 1, 0);
    }

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

P get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt == p) continue;
        P p = get_res(x, nxt, v);
        com += p.first;
        if(p.second > mx1) mx2 = mx1, mx1 = p.second;
        else if(p.second > mx2) mx2 = p.second;
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

void solve(int l, int r){
    int x;
    if((x = get_res(l, 1, 0).first) == get_res(r, 1, 0).first){
        for(int j = l; j <= r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l, mid), solve(mid + 1, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    solve(1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

P get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt == p) continue;
        P p = get_res(x, nxt, v);
        com += p.first;
        if(p.second > mx1) mx2 = mx1, mx1 = p.second;
        else if(p.second > mx2) mx2 = p.second;
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

void solve(int l, int r){
    int x;
    if((x = get_res(l, 1, 0).first) == get_res(r, 1, 0).first){
        for(int j = l; j <= r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(1, mid), solve(mid + 1, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    solve(1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 1000;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

P get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt == p) continue;
        P p = get_res(x, nxt, v);
        com += p.first;
        if(p.second > mx1) mx2 = mx1, mx1 = p.second;
        else if(p.second > mx2) mx2 = p.second;
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

void solve(int l, int r){
    int x;
    if((x = get_res(l, 1, 0).first) == get_res(r, 1, 0).first){
        for(int j = l; j <= r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l, mid), solve(mid + 1, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int i = 1; i <= min(SQRT, n); i++) res[i] = get_res(i, 1, 0).first;

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 1000;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];
int fir[N], sec[N];

int get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt == p) continue;
        get_res(x, nxt, v);
        com += fir[nxt];
        if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
        else if(sec[nxt] > mx2) mx2 = sec[nxt];
    }
    if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
    else fir[v] = com, sec[v] = mx1 + 1;
    return fir[v];
}

int get(int x){
    if(res[x] != -1) return res[x];
    else return res[x] = get_res(x, 1, 0);
}

void solve(int l, int r){
    if(l > r) return ;
    int x = get(l), y = get(r);
    if(l + 1 == r || x == y){
        for(int j = l + 1; j < r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l, mid), solve(mid, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    fill(res, res + n + 1, -1);
    for(int i = 1; i <= min(SQRT, n); i++){
        res[i] = get(i);
    }

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 125;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];
int fir[N], sec[N];
int ord[N], fa[N];
int T = 0;

void dfs(int v, int p){
    for(int nxt : G[v]) if(nxt != p) dfs(nxt, v);
    fa[v] = p;
    ord[T++] = v;
}

//int get_res(int x, int v, int p){
//    int com = 0;
//    int mx1 = 0, mx2 = 0;
//    for(int nxt : G[v]){
//        if(nxt == p) continue;
//        get_res(x, nxt, v);
//        com += fir[nxt];
//        if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
//        else if(sec[nxt] > mx2) mx2 = sec[nxt];
//    }
//    if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
//    else fir[v] = com, sec[v] = mx1 + 1;
//    return fir[v];
//}

int get_res(int x){
    for(int i = 0; i < n; i++){
        int v = ord[i];
        int com = 0, mx1 = 0, mx2 = 0;
        for(int nxt : G[v]){
            if(nxt == fa[v]) continue;
            com += fir[nxt];
            if(sec[nxt] > mx1) mx2 = mx1, mx1 = sec[nxt];
            else if(sec[nxt] > mx2) mx2 = sec[nxt];
        }
        if(mx1 + mx2 >= x - 1) fir[v] = com + 1, sec[v] = 0;
        else fir[v] = com, sec[v] = mx1 + 1;
    }
    return fir[ord[n-1]];
}

int get(int x){
    if(res[x] != -1) return res[x];
    else return res[x] = get_res(x);
}

void solve(int l, int r){
    if(l > r) return ;
    int x = get(l), y = get(r);
    if(l + 1 == r || x == y){
        for(int j = l + 1; j < r; j++) res[j] = x;
        return ;
    }
    int mid = (l + r) / 2;
    solve(l, mid), solve(mid, r);

}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1, 0);
    fill(res, res + n + 1, -1);
    for(int i = 1; i <= min(SQRT, n); i++){
        res[i] = get(i);
    }

    if(n >= SQRT + 1) solve(SQRT + 1, n);
    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);
}


#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5 + 500;
const int BK = 100, BKSIZE = 1005;
const int SQRT = 317;
typedef pair<int, int> P;

int n;
vector<int> G[N];
int res[N];
int upp[N];

P get_res(int x, int v, int p){
    int com = 0;
    int mx1 = 0, mx2 = 0;
    for(int nxt : G[v]){
        if(nxt != p){
            P p = get_res(x, nxt, v);
            com += p.first;
            if(p.second > mx1) mx2 = mx1, mx1 = p.second;
            else if(p.second > mx2) mx2 = p.second;
        }
    }
    return (mx1 + mx2 >= x - 1) ? make_pair(com + 1, 0) : make_pair(com, mx1 + 1);
}

int get_upp(int ans){
    int l = 1, r = n + 1, mid;
    while(l + 1 < r){
        mid = (l + r) / 2;
        if(get_res(mid, 1, -1).first >= ans) l = mid;
        else r = mid;
    }
    return l;
}

int main(){
    scanf("%d", &n);
    for(int i = 0; i < n - 1; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int k = 1; k <= min(BKSIZE, n); k++){
        res[k] = get_res(k, 1, -1).first;
    }
    upp[0] = n;
    for(int i = 1; i <= BK; i++) upp[i] = get_upp(i);
//    for(int i = 1; i <=n; i++) cout << upp[i] << " ";
//    cout << endl;

    int cur = BK;
    for(int i = BKSIZE + 1; i <= n; i++){
        while(upp[cur] < i) cur--;
        res[i] = cur;
    }

    for(int i = 1; i <= n; i++) printf("%d\n", res[i]);

}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <stack>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mk make_pair
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9')
    {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9')
        x = (x << 1) + (x << 3) + c - '0', c = getchar();
    return x * f;
}

vector<int> g[N];
int f[N], rt;
int res = 0;
void dfs(int x, int fa, int k)
{

    int mx1 = 0, mx2 = 0;
    for (int to : g[x])
    {
        if (to == fa)
            continue;
        dfs(to, x, k);
        if (f[to] >= mx1)
            mx2 = mx1, mx1 = f[to];
        else if (mx2 < f[to])
            mx2 = f[to];
    }

    if (mx1 + 1 == k)
        res++, f[x] = 0;
    else if (mx1 + mx2 + 1 >= k)
        res++, f[x] = 0;
    else
        f[x] = mx1 + 1;
}

int solve(int n, int k)
{
    res = 0;
    for (int i = 1; i <= n; i++)
        f[i] = 0;

    dfs(1, 0, k);
    return res;
}
int main()
{
    int n = read();
    int block = sqrt(n * log(n) / log(2));
    for (int i = 1; i < n; i++)
    {
        int u = read(), v = read();
        g[u].push_back(v);
        g[v].push_back(u);
    }
    vector<int> ans(n + 1);
    for (int i = 1; i <= block; i++)
    {
        ans[i] = solve(n, i);
    }
    for (int i = block + 1, j; i <= n; i = j + 1)
    {
        int o = solve(n, i);
        int l = i, r = n;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            int z = solve(n, mid);
            if (z == o)
            {
                j = mid;
                l = mid + 1;
            }
            else
                r = mid - 1;
        }
        for (int t = i; t <= j; t++)
            ans[t] = o;
    }
    for (int i = 1; i <= n; i++)
        printf("%d\n", ans[i]);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <stack>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mk make_pair
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9')
    {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9')
        x = (x << 1) + (x << 3) + c - '0', c = getchar();
    return x * f;
}

vector<int> g[N];
int f[N], rt;
int res = 0;
void dfs(int x, int fa, int k)
{

    int mx1 = 0, mx2 = 0;
    for (int to : g[x])
    {
        if (to == fa)
            continue;
        dfs(to, x, k);
        if (f[to] >= mx1)
            mx2 = mx1, mx1 = f[to];
        else if (mx2 < f[to])
            mx2 = f[to];
    }

    if (mx1 + 1 == k)
        res++, f[x] = 0;
    else if (mx1 + mx2 + 1 >= k)
        res++, f[x] = 0;
    else
        f[x] = mx1 + 1;
}

int solve(int n, int k)
{
    res = 0;
    for (int i = 1; i <= n; i++)
        f[i] = 0;

    dfs(1, 0, k);
    return res;
}
int ans[N];
int n;
void dfs(int l, int r, int L, int R)
{
    if (l > r || L > R)
        return;
    if (L == R)
    {
        for (int i = l; i <= r; i++)
            ans[i] = L;
        return;
    }
    int mid = (l + r) >> 1;
    int res = solve(n, mid);
    ans[mid] = res;
    dfs(l, mid - 1, res, R);
    dfs(mid + 1, r, L, res);
}
int main()
{
    n = read();
    int block = min(n, 200);
    for (int i = 1; i < n; i++)
    {
        int u = read(), v = read();
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1, n, 1, n);
    // for (int i = 1; i <= block; i++)
    // {
    //     ans[i] = solve(n, i);
    // }
    // for (int i = block + 1, j; i <= n; i = j + 1)
    // {
    //     int o = solve(n, i);
    //     int l = i, r = n;
    //     while (l <= r)
    //     {
    //         int mid = (l + r) >> 1;
    //         int z = solve(n, mid);
    //         if (z == o)
    //         {
    //             j = mid;
    //             l = mid + 1;
    //         }
    //         else
    //             r = mid - 1;
    //     }
    //     for (int t = i; t <= j; t++)
    //         ans[t] = o;
    // }
    for (int i = 1; i <= n; i++)
        printf("%d\n", ans[i]);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <stack>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mk make_pair
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9')
    {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9')
        x = (x << 1) + (x << 3) + c - '0', c = getchar();
    return x * f;
}

vector<int> g[N];
int f[N], rt;
int res = 0;
void dfs(int x, int fa, int k)
{

    int mx1 = 0, mx2 = 0;
    for (int to : g[x])
    {
        if (to == fa)
            continue;
        dfs(to, x, k);
        if (f[to] >= mx1)
            mx2 = mx1, mx1 = f[to];
        else if (mx2 < f[to])
            mx2 = f[to];
    }

    if (mx1 + 1 == k)
        res++, f[x] = 0;
    else if (mx1 + mx2 + 1 >= k)
        res++, f[x] = 0;
    else
        f[x] = mx1 + 1;
}

int solve(int n, int k)
{
    res = 0;
    for (int i = 1; i <= n; i++)
        f[i] = 0;

    dfs(1, 0, k);
    return res;
}
int main()
{
    int n = read();
    int block = min(n,200);
    for (int i = 1; i < n; i++)
    {
        int u = read(), v = read();
        g[u].push_back(v);
        g[v].push_back(u);
    }
    vector<int> ans(n + 1);
    for (int i = 1; i <= block; i++)
    {
        ans[i] = solve(n, i);
    }
    for (int i = block + 1, j; i <= n; i = j + 1)
    {
        int o = solve(n, i);
        int l = i, r = n;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            int z = solve(n, mid);
            if (z == o)
            {
                j = mid;
                l = mid + 1;
            }
            else
                r = mid - 1;
        }
        for (int t = i; t <= j; t++)
            ans[t] = o;
    }
    for (int i = 1; i <= n; i++)
        printf("%d\n", ans[i]);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <stack>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mk make_pair
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9')
    {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9')
        x = (x << 1) + (x << 3) + c - '0', c = getchar();
    return x * f;
}

vector<int> g[N];
int f[N], rt;
int res = 0;
void dfs(int x, int fa, int k)
{

    int mx1 = 0, mx2 = 0;
    for (int to : g[x])
    {
        if (to == fa)
            continue;
        dfs(to, x, k);
        if (f[to] >= mx1)
            mx2 = mx1, mx1 = f[to];
        else if (mx2 < f[to])
            mx2 = f[to];
    }

    if (mx1 + 1 == k)
        res++, f[x] = 0;
    else if (mx1 + mx2 + 1 >= k)
        res++, f[x] = 0;
    else
        f[x] = mx1 + 1;
}

int solve(int n, int k)
{
    res = 0;
    for (int i = 1; i <= n; i++)
        f[i] = 0;

    dfs(1, 0, k);
    return res;
}
int ans[N];
int n;
void dfs(int l, int r, int L, int R)
{
    if (l > r || L > R)
        return;
    if (L == R)
    {
        for (int i = l; i <= r; i++)
            ans[i] = L;
        return;
    }
    int mid = (l + r) >> 1;
    int res = solve(n, mid);
    ans[mid] = res;
    dfs(l, mid - 1, res, R);
    dfs(mid + 1, r, L, res);
}
int main()
{
    n = read();
    int block = min(n, 200);
    for (int i = 1; i < n; i++)
    {
        int u = read(), v = read();
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1, n, 0, n);
    // for (int i = 1; i <= block; i++)
    // {
    //     ans[i] = solve(n, i);
    // }
    // for (int i = block + 1, j; i <= n; i = j + 1)
    // {
    //     int o = solve(n, i);
    //     int l = i, r = n;
    //     while (l <= r)
    //     {
    //         int mid = (l + r) >> 1;
    //         int z = solve(n, mid);
    //         if (z == o)
    //         {
    //             j = mid;
    //             l = mid + 1;
    //         }
    //         else
    //             r = mid - 1;
    //     }
    //     for (int t = i; t <= j; t++)
    //         ans[t] = o;
    // }
    for (int i = 1; i <= n; i++)
        printf("%d\n", ans[i]);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <stack>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mk make_pair
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9')
    {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9')
        x = (x << 1) + (x << 3) + c - '0', c = getchar();
    return x * f;
}

vector<int> g[N];
int f[N], rt;
int res = 0;
void dfs(int x, int fa, int k)
{

    int mx1 = 0, mx2 = 0;
    for (int to : g[x])
    {
        if (to == fa)
            continue;
        dfs(to, x, k);
        if (f[to] >= mx1)
            mx2 = mx1, mx1 = f[to];
        else if (mx2 < f[to])
            mx2 = f[to];
    }

    if (mx1 + 1 == k)
        res++, f[x] = 0;
    else if (mx1 + mx2 + 1 >= k)
        res++, f[x] = 0;
    else
        f[x] = mx1 + 1;
}

int solve(int n, int k)
{
    res = 0;
    for (int i = 1; i <= n; i++)
        f[i] = 0;

    dfs(1, 0, k);
    return res;
}
int main()
{
    int n = read();
    //int block = ;
    for (int i = 1; i < n; i++)
    {
        int u = read(), v = read();
        g[u].push_back(v);
        g[v].push_back(u);
    }

    for (int i = 1; i <= n; i++)
    {
        cout << solve(n, i) << endl;
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <stack>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mk make_pair
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int read()
{
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9')
    {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9')
        x = (x << 1) + (x << 3) + c - '0', c = getchar();
    return x * f;
}

vector<int> g[N];
int mx1[N], mx2[N], dfn[N], tot, z[N];

void dfs(int x, int fa)
{
    for (int to : g[x])
    {
        if (to == fa)
            continue;
        dfs(to, x);
    }
    z[x] = fa;
    dfn[++tot] = x;
}

int solve(int n, int k)
{
    int res = 0;
    for (int i = 1; i <= n; i++)
        mx1[i] = mx2[i] = 0;
    for (int i = 1; i <= n; i++)
    {
        int x = dfn[i], y = z[x];
        if (mx1[x] + mx2[x] + 1 >= k)
        {
            res++;
        }
        else
        {
            int tmp = mx1[x] + 1;
            if (tmp >= mx1[y])
                mx2[y] = mx1[y], mx1[y] = tmp;
            else if (tmp > mx2[y])
                mx2[y] = tmp;
        }
    }

    return res;
}
int main()
{
    int n = read();
    int block = min(n, 200);
    for (int i = 1; i < n; i++)
    {
        int u = read(), v = read();
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1, 0);
    vector<int> ans(n + 1);
    for (int i = 1; i <= block; i++)
    {
        ans[i] = solve(n, i);
    }
    for (int i = block + 1, j; i <= n; i = j + 1)
    {
        int o = solve(n, i);
        int l = i, r = n;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            int z = solve(n, mid);
            if (z == o)
            {
                j = mid;
                l = mid + 1;
            }
            else
                r = mid - 1;
        }
        for (int t = i; t <= j; t++)
            ans[t] = o;
    }
    for (int i = 1; i <= n; i++)
        printf("%d\n", ans[i]);
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Random;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			Input in = new Input(inputStream);
			Output out = new Output(outputStream);
			BSubwayPursuit solver = new BSubwayPursuit();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class BSubwayPursuit {
		Random rand = new Random();
		InputReader in;
		Output pw;
		long n;
		long k;
		long l;
		long r;

		public BSubwayPursuit() {
		}

		public void bsearch() {
			while((r-l)>k<<2) {
				long mid = r+l >> 1;
				pw.println(l, mid);
				pw.flush();
				boolean valid = in.next().charAt(0)=='Y';
				if(valid) {
					r = mid;
				}else {
					l = mid+1;
				}
				updateRange();
			}
		}

		public void updateRange() {
			r += k;
			l -= k;
			r = Math.min(r, n);
			l = Math.max(l, 1);
		}

		public long randLong() {
			long a = rand.nextInt(), b = rand.nextInt();
			return Math.abs(((a^(b >>> 16))<<32)|((a >>> 16)^b));
		}

		public long rand() {
			return randLong()%(r-l+1)+l;
		}

		public void solve(int kase, InputReader in, Output pw) {
			this.in = in;
			this.pw = pw;
			n = in.nextLong();
			k = in.nextInt();
			l = 1;
			r = n;
			do {
				bsearch();
				if(l==r) {
					break;
				}
//				Utilities.Debug.dbg(l, r);
				long query = rand();
				pw.println(query, query);
				pw.flush();
				updateRange();
			} while(in.next().charAt(0)=='N');
		}

	}

	static interface InputReader {
		String next();

		int nextInt();

		long nextLong();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void println(Object... o) {
			for(int i = 0; i<o.length; i++) {
				if(i!=0) {
					print(" ");
				}
				print(String.valueOf(o[i]));
			}
			println();
		}

		public void println() {
			sb.append(lineSeparator);
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}

	static class Input implements InputReader {
		BufferedReader br;
		StringTokenizer st;

		public Input(InputStream is) {
			this(is, 1<<20);
		}

		public Input(InputStream is, int bs) {
			br = new BufferedReader(new InputStreamReader(is), bs);
			st = new StringTokenizer("");
		}

		public boolean hasNext() {
			try {
				while(st==null||!st.hasMoreTokens()) {
					String s = br.readLine();
					if(s==null) {
						return false;
					}
					st = new StringTokenizer(s);
				}
				return true;
			}catch(Exception e) {
				return false;
			}
		}

		public String next() {
			if(!hasNext()) {
				throw new InputMismatchException();
			}
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Random;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			Input in = new Input(inputStream);
			Output out = new Output(outputStream);
			BSubwayPursuit solver = new BSubwayPursuit();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class BSubwayPursuit {
		Random rand = new Random();
		InputReader in;
		Output pw;
		long n;
		long k;
		long l;
		long r;

		public BSubwayPursuit() {
		}

		public void bsearch() {
			while((r-l)>k<<2) {
				long mid = r+l >> 1;
				pw.println(l, mid);
				pw.flush();
				boolean valid = in.next().charAt(0)=='Y';
				if(valid) {
					r = mid;
				}else {
					l = mid+1;
				}
				updateRange();
			}
		}

		public void updateRange() {
			r += k;
			l -= k;
			r = Math.min(r, n);
			l = Math.max(l, 1);
		}

		public long randLong() {
			long a = rand.nextInt(), b = rand.nextInt();
			return Math.abs(((a^(b >>> 16))<<32)|((a >>> 16)^b));
		}

		public long rand() {
			return randLong()%(r-l+1)+l;
		}

		public void solve(int kase, InputReader in, Output pw) {
			this.in = in;
			this.pw = pw;
			n = in.nextLong();
			k = in.nextInt();
			l = 1;
			r = n;
			do {
				bsearch();
//				Utilities.Debug.dbg(l, r);
				if(l==r&&n>1) {
					break;
				}
				long query = rand();
				pw.println(query, query);
				pw.flush();
				updateRange();
			} while(in.next().charAt(0)=='N');
		}

	}

	static interface InputReader {
		String next();

		int nextInt();

		long nextLong();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void println(Object... o) {
			for(int i = 0; i<o.length; i++) {
				if(i!=0) {
					print(" ");
				}
				print(String.valueOf(o[i]));
			}
			println();
		}

		public void println() {
			sb.append(lineSeparator);
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}

	static class Input implements InputReader {
		BufferedReader br;
		StringTokenizer st;

		public Input(InputStream is) {
			this(is, 1<<20);
		}

		public Input(InputStream is, int bs) {
			br = new BufferedReader(new InputStreamReader(is), bs);
			st = new StringTokenizer("");
		}

		public boolean hasNext() {
			try {
				while(st==null||!st.hasMoreTokens()) {
					String s = br.readLine();
					if(s==null) {
						return false;
					}
					st = new StringTokenizer(s);
				}
				return true;
			}catch(Exception e) {
				return false;
			}
		}

		public String next() {
			if(!hasNext()) {
				throw new InputMismatchException();
			}
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}


import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Random;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			FastReader in = new FastReader(inputStream);
			Output out = new Output(outputStream);
			BSubwayPursuit solver = new BSubwayPursuit();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class BSubwayPursuit {
		Random rand = new Random();
		InputReader in;
		Output pw;
		long n;
		long k;
		long l;
		long r;

		public BSubwayPursuit() {
		}

		public void bsearch() {
			while((r-l)>k<<2) {
				long mid = r+l >> 1;
				pw.println(l, mid);
				pw.flush();
				boolean valid = in.next().charAt(0)=='Y';
				if(valid) {
					r = mid;
				}else {
					l = mid+1;
				}
				updateRange();
			}
		}

		public void updateRange() {
			r += k;
			l -= k;
			r = Math.min(r, n);
			l = Math.max(l, 1);
		}

		public long randLong() {
			long a = rand.nextInt(), b = rand.nextInt();
			return Math.abs(((a^(b >>> 16))<<32)|((a >>> 16)^b));
		}

		public long rand() {
			return randLong()%(r-l+1)+l;
		}

		public void solve(int kase, InputReader in, Output pw) {
			this.in = in;
			this.pw = pw;
			n = in.nextLong();
			k = in.nextInt();
			l = 1;
			r = n;
			do {
				bsearch();
//				Utilities.Debug.dbg(l, r);
				long query = rand();
				pw.println(query, query);
				pw.flush();
				updateRange();
			} while(in.next().charAt(0)=='N');
		}

	}

	static class FastReader implements InputReader {
		final private int BUFFER_SIZE = 1<<16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer;
		private int bytesRead;

		public FastReader(InputStream is) {
			din = new DataInputStream(is);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String next() {
			StringBuilder ret = new StringBuilder(64);
			byte c = skip();
			while(c!=-1&&!isSpaceChar(c)) {
				ret.appendCodePoint(c);
				c = read();
			}
			return ret.toString();
		}

		public int nextInt() {
			int ret = 0;
			byte c = skipToDigit();
			boolean neg = (c=='-');
			if(neg) {
				c = read();
			}
			do {
				ret = ret*10+c-'0';
			} while((c = read())>='0'&&c<='9');
			if(neg) {
				return -ret;
			}
			return ret;
		}

		public long nextLong() {
			long ret = 0;
			byte c = skipToDigit();
			boolean neg = (c=='-');
			if(neg) {
				c = read();
			}
			do {
				ret = ret*10+c-'0';
			} while((c = read())>='0'&&c<='9');
			if(neg) {
				return -ret;
			}
			return ret;
		}

		private boolean isSpaceChar(byte b) {
			return b==' '||b=='\r'||b=='\n'||b=='\t'||b=='\f';
		}

		private byte skip() {
			byte ret;
			while(isSpaceChar((ret = read()))) ;
			return ret;
		}

		private boolean isDigit(byte b) {
			return b>='0'&&b<='9';
		}

		private byte skipToDigit() {
			byte ret;
			while(!isDigit(ret = read())&&ret!='-') ;
			return ret;
		}

		private void fillBuffer() {
			try {
				bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			}catch(IOException e) {
				e.printStackTrace();
				throw new InputMismatchException();
			}
			if(bytesRead==-1) {
				buffer[0] = -1;
			}
		}

		private byte read() {
			if(bytesRead==-1) {
				throw new InputMismatchException();
			}else if(bufferPointer==bytesRead) {
				fillBuffer();
			}
			return buffer[bufferPointer++];
		}

	}

	static interface InputReader {
		String next();

		int nextInt();

		long nextLong();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void println(Object... o) {
			for(int i = 0; i<o.length; i++) {
				if(i!=0) {
					print(" ");
				}
				print(String.valueOf(o[i]));
			}
			println();
		}

		public void println() {
			sb.append(lineSeparator);
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Random;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			Input in = new Input(inputStream);
			Output out = new Output(outputStream);
			BSubwayPursuit solver = new BSubwayPursuit();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class BSubwayPursuit {
		Random rand = new Random();
		InputReader in;
		Output pw;
		long n;
		long k;
		long l;
		long r;

		public BSubwayPursuit() {
		}

		public void bsearch() {
			while((r-l)>k<<2) {
				long mid = r+l >> 1;
				pw.println(l, mid);
				pw.flush();
				boolean valid = in.next().charAt(0)=='Y';
				if(valid) {
					r = mid;
				}else {
					l = mid+1;
				}
				updateRange();
			}
		}

		public void updateRange() {
			r += k;
			l -= k;
			r = Math.min(r, n);
			l = Math.max(l, 1);
		}

		public long randLong() {
			long a = rand.nextInt(), b = rand.nextInt();
			return Math.abs(((a^(b >>> 16))<<32)|((a >>> 16)^b));
		}

		public long rand() {
			return randLong()%(r-l+1)+l;
		}

		public void solve(int kase, InputReader in, Output pw) {
			this.in = in;
			this.pw = pw;
			n = in.nextLong();
			k = in.nextInt();
			l = 1;
			r = n;
			do {
				bsearch();
//				Utilities.Debug.dbg(l, r);
				long query = rand();
				pw.println(query, query);
				pw.flush();
				updateRange();
			} while(in.next().charAt(0)=='N');
		}

	}

	static interface InputReader {
		String next();

		int nextInt();

		long nextLong();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void println(Object... o) {
			for(int i = 0; i<o.length; i++) {
				if(i!=0) {
					print(" ");
				}
				print(String.valueOf(o[i]));
			}
			println();
		}

		public void println() {
			sb.append(lineSeparator);
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}

	static class Input implements InputReader {
		BufferedReader br;
		StringTokenizer st;

		public Input(InputStream is) {
			this(is, 1<<20);
		}

		public Input(InputStream is, int bs) {
			br = new BufferedReader(new InputStreamReader(is), bs);
			st = new StringTokenizer("");
		}

		public boolean hasNext() {
			try {
				while(st==null||!st.hasMoreTokens()) {
					String s = br.readLine();
					if(s==null) {
						return false;
					}
					st = new StringTokenizer(s);
				}
				return true;
			}catch(Exception e) {
				return false;
			}
		}

		public String next() {
			if(!hasNext()) {
				throw new InputMismatchException();
			}
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Random;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			Input in = new Input(inputStream);
			Output out = new Output(outputStream);
			BSubwayPursuit solver = new BSubwayPursuit();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class BSubwayPursuit {
		Random rand = new Random();
		InputReader in;
		Output pw;
		long n;
		long k;
		long l;
		long r;

		public BSubwayPursuit() {
		}

		public boolean bsearch() {
			boolean equal = false;
			while((r-l)>k<<2) {
				long mid = r+l >> 1;
				pw.println(l, mid);
				pw.flush();
				boolean valid = in.next().charAt(0)=='Y';
				if(valid) {
					r = mid;
				}else {
					l = mid+1;
				}
				if(l==mid&&valid) {
					equal = true;
				}
				updateRange();
			}
			return equal;
		}

		public void updateRange() {
			r += k;
			l -= k;
			r = Math.min(r, n);
			l = Math.max(l, 1);
		}

		public long randLong() {
			long a = rand.nextInt(), b = rand.nextInt();
			return Math.abs(((a^(b >>> 16))<<32)|((a >>> 16)^b));
		}

		public long rand() {
			return randLong()%(r-l+1)+l;
		}

		public void solve(int kase, InputReader in, Output pw) {
			this.in = in;
			this.pw = pw;
			n = in.nextLong();
			k = in.nextInt();
			l = 1;
			r = n;
			do {
				if(bsearch()) {
					break;
				}
//				Utilities.Debug.dbg(l, r);
				long query = rand();
				pw.println(query, query);
				pw.flush();
				updateRange();
			} while(in.next().charAt(0)=='N');
		}

	}

	static interface InputReader {
		String next();

		int nextInt();

		long nextLong();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void println(Object... o) {
			for(int i = 0; i<o.length; i++) {
				if(i!=0) {
					print(" ");
				}
				print(String.valueOf(o[i]));
			}
			println();
		}

		public void println() {
			sb.append(lineSeparator);
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}

	static class Input implements InputReader {
		BufferedReader br;
		StringTokenizer st;

		public Input(InputStream is) {
			this(is, 1<<20);
		}

		public Input(InputStream is, int bs) {
			br = new BufferedReader(new InputStreamReader(is), bs);
			st = new StringTokenizer("");
		}

		public boolean hasNext() {
			try {
				while(st==null||!st.hasMoreTokens()) {
					String s = br.readLine();
					if(s==null) {
						return false;
					}
					st = new StringTokenizer(s);
				}
				return true;
			}catch(Exception e) {
				return false;
			}
		}

		public String next() {
			if(!hasNext()) {
				throw new InputMismatchException();
			}
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}


#include<bits/stdc++.h>

#define int long long
using namespace std;

int n, k;

int ask(int l, int r) {
    cout << l << ' ' << r << endl;
    string s;
    cin >> s;
    return s[0] == 'Y';
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> k;
    int l = 1, r = n;
    for (;;) {
        l = max(l - k, 1int);
        r = min(r + k, n);
        if (r - l <= 100) {
            int w = rand() % (r - l + 1) + l;
            if (ask(w, w)) return 0;
        }
        else {
            int mid = l + r >> 1;
            if (ask(l, mid)) r = mid;
            else l = mid + 1;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

bool ask(int l, int r) {
    cout << l << ' ' << r << endl;
    char c; cin >> c; return c == 'Y';
}

int main() {
    ios_base::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;
    int l = 1, r = n;

    for (;;) {
        l = max(l - k, 1), r = min(r + k, n);
        if (r - l <= 100) {
            int w = rand() % (r - l + 1) + l;
            if (ask(w, w)) return 0;
        }
        else {
            int m = (l + r) / 2; if (ask(l, m)) r = m; else l = m + 1;
        }
    }

}


#include <bits/stdc++.h>
#define int long long

using namespace std;

bool check(int l, int r) {
    cout << l << ' ' << r << '\n';
    string res;
    cin >> res;
    return res == "Yes";
}

signed main() {
    ios_base::sync_with_stdio(0);
    int n, k;
    cin >> n >> k;
    int l = 1, r = n;
    while (true) {
        int m = (l + r) >> 1LL;
        if (r - l <= (k << 2LL) + 1LL) {
            m = (rand() ^ rand()) % (r - l + 1ll);
            if (check(l + m, l + m)) return 0;
        }
        else if (check(l, m)) r = m;
        else l = m + 1;
        l = max(1ll, l - k);
        r = min(n, r + k);
    }
}


#include<bits/stdc++.h>

#define int long long
using namespace std;

int n, k;

int ask(int l, int r) {
    cout << l << ' ' << r << endl;
    string s; cin >> s; return s[0] == 'Y';
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> k;
    int l = 1, r = n;
    for (;;) {
        l = max(l - k, 1ll);
        r = min(r + k, n);
        if (r - l <= 100) {
            int w = rand() % (r - l + 1) + l;
            if (ask(w, w)) return 0;
        }
        else {
            int mid = (l + r) / 2;
            if (ask(l, mid)) r = mid;
            else l = mid + 1;
        }
    }
}


#include<bits/stdc++.h>

#define int long long
using namespace std;

int n, k;

int ask(int l, int r) {
    cout << l << ' ' << r << endl;
    string s;
    cin >> s;
    return s[0] == 'Y';
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> k;
    int l = 1, r = n;
    for (;;) {
        l = max(l - k, 1ll);
        r = min(r + k, n);
        if (r - l <= 100) {
            int w = rand() % (r - l + 1) + l;
            if (ask(w, w)) return 0;
        }
        else {
            int mid = l + r >> 1;
            if (ask(l, mid)) r = mid;
            else l = mid + 1;
        }
    }
}


#include<bits/stdc++.h>

#define int long long
using namespace std;

int n, k;

int ask(int l, int r) {
    cout << l << ' ' << r << endl;
    string s;
    cin >> s;
    return s[0] == 'Y';
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> k;
    int l = 1, r = n;
    for (;;) {
        l = max(l - k, 1);
        r = min(r + k, n);
        if (r - l <= 100) {
            int w = rand() % (r - l + 1) + l;
            if (ask(w, w)) return 0;
        }
        else {
            int mid = l + r >> 1;
            if (ask(l, mid)) r = mid;
            else l = mid + 1;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n, k;
	cin >> n >> k;
	ll lo = 1, hi = n;
	while(hi - lo > max(10LL, 10*k)) {
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			hi = min(n, mid + k);
			lo = max(lo - k, 1LL);
		} else {
			lo = max(1LL, mid - k + 1);
			hi = min(hi + k, n);
		}
	}

	while(1) {

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
		lo = max(1LL, lo - k);
		hi = min(n, hi + k);
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			lo = max(1LL, lo - k);
			hi = min(mid + k, n);
		} else {
			lo = max(mid - k + 1, 1LL);
			hi = min(n, hi + k);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n, k;
	cin >> n >> k;

	while(1) {
		ll lo = 1, hi = n;
		while(hi - lo > max(5LL, 5*k)) {
			ll mid = lo + (hi - lo)/2;
			cout << lo << ' ' << mid << endl;
			string ans;
			cin >> ans;
			if(ans == "Bad") return 0;
			if(ans == "Yes") {
				hi = min(n, mid + k);
				lo = max(lo - k, 1LL);
			} else {
				lo = max(1LL, mid - k);
				hi = min(hi + k, n);
			}
		}

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
	}
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n, k;
	cin >> n >> k;
	ll lo = 1, hi = n;
	while(hi - lo > max(5LL, 6*k)) {
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			hi = min(n, mid + k);
			lo = max(lo - k, 1LL);
		} else {
			lo = max(1LL, mid - k);
			hi = min(hi + k, n);
		}
	}

	while(1) {

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			lo = max(1LL, lo - k);
			hi = min(mid + k, n);
		} else {
			lo = max(mid - k, 1LL);
			hi = min(n, hi + k);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n, k;
	cin >> n >> k;
	ll lo = 1, hi = n;
	while(hi - lo > max(5LL, 6*k)) {
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			hi = min(n, mid + k);
			lo = max(lo - k, 1LL);
		} else {
			lo = max(1LL, mid - k + 1);
			hi = min(hi + k, n);
		}
	}

	while(1) {

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			lo = max(1LL, lo - k);
			hi = min(mid + k, n);
		} else {
			lo = max(mid - k + 1, 1LL);
			hi = min(n, hi + k);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

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

	ll n, k;
	cin >> n >> k;

	while(1) {
		ll lo = 1, hi = n;
		while(hi - lo > 5*k) {
			ll mid = lo + (hi - lo)/2;
			cout << lo << ' ' << mid << endl;
			string ans;
			cin >> ans;
			if(ans == "Bad") return 0;
			if(ans == "Yes") {
				hi = min(n, mid + k);
				lo = max(lo - k, 0LL);
			} else {
				lo = max(0LL, mid - k);
				hi = min(hi + k, n);
			}
		}

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
	}
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n, k;
	cin >> n >> k;

	while(1) {
		ll lo = 1, hi = n;
		while(hi - lo > max(5LL, 5*k)) {
			ll mid = lo + (hi - lo)/2;
			cout << lo << ' ' << mid << endl;
			string ans;
			cin >> ans;
			if(ans == "Bad") return 0;
			if(ans == "Yes") {
				hi = min(n, mid + k);
				lo = max(lo - k, 0LL);
			} else {
				lo = max(0LL, mid - k);
				hi = min(hi + k, n);
			}
		}

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
	}
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n, k;
	cin >> n >> k;
	ll lo = 1, hi = n;
	while(hi - lo > max(5LL, 5*k)) {
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			hi = min(n, mid + k);
			lo = max(lo - k, 1LL);
		} else {
			lo = max(1LL, mid - k);
			hi = min(hi + k, n);
		}
	}

	while(1) {

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
		ll mid = lo + (hi - lo)/2;
		cout << lo << ' ' << mid << endl;
		cin >> ans;
		if(ans == "Bad") return 0;
		if(ans == "Yes") {
			lo = max(1LL, lo - k);
			hi = min(mid + k, n);
		} else {
			lo = max(mid - k, 1LL);
			hi = min(n, hi + k);
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

ll rand(ll a, ll b) {
	return a + rng() % (b - a + 1);
}

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

	ll n, k;
	cin >> n >> k;

	while(1) {
		ll lo = 1, hi = n;
		while(hi - lo > max(5LL, 5*k)) {
			ll mid = lo + (hi - lo)/2;
			cout << lo << ' ' << mid << endl;
			string ans;
			cin >> ans;
			if(ans == "Bad") return 0;
			if(ans == "Yes") {
				hi = min(n, mid + k);
				lo = max(lo - k, 0LL);
			} else {
				lo = max(0LL, mid - k);
				hi = min(hi + k, n);
			}
		}

		ll guess = rand(lo, hi);
		cout << guess << ' ' << guess << endl;
		string ans;
		cin >> ans;
		if(ans == "Bad" || ans == "Yes") return 0;
	}
}


#include<bits/stdc++.h>
#define out(x) cout<<x<<endl
#define _ << " " <<
using namespace std;
using ll=long long;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int ask(ll l,ll r){
  out(l _ r);
  char str[4];
  cin >> str;
  if(str[0]=='B')exit(0);
  return str[0]=='Y';
}

int main(){
  ll n,k;
  cin>>n>>k;
  ll l=1,r=n;
  while(1){
    while(r-l>4*k){
      ll m=(l+r)/2;
      if(ask(l,m)){
        l=max(1LL,l-k);
        r=min(m+k,n);
      }else{
        l=max(1LL,m+1-k);
        r=min(r+k,n);
      }
    }
    ll x=rng()%(r-l+1)+l;
    if(ask(x,x))return 0;
    l=max(1LL,l-k);
    r=min(r+k,n);
  }
}


#include<bits/stdc++.h>
#define out(x) cout<<x<<endl
#define _ << " " <<
using namespace std;
using ll=long long;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int ask(ll l,ll r){
  out(l _ r);
  char str[4];
  cin>>str;
  if(str[0]=='B')exit(0);
  return str[0]=='Y';
}

int main(){
  ll n,k;
  cin>>n>>k;
  ll l=1,r=n;
  while(1){
    while(r-l+1>4*k){
      ll m=(l+r)/2;
      if(ask(l,m)){
        l=max(1LL,l-k);
        r=min(m+k,n);
      }else{
        l=max(1LL,m+1-k);
        r=min(r+k,n);
      }
    }
    ll x=rng()%(r-l+1)+l;
    if(ask(x,x))return 0;
    l=max(1LL,l-k);
    r=min(r+k,n);
  }
}


#include<bits/stdc++.h>
#define _ << " " <<
using namespace std;
using ll=long long;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int ask(ll l,ll r){
  cout<<l _ r<<endl;
  char str[4];
  cin>>str;
  if(str[0]=='B')exit(0);
  return str[0]=='Y';
}

int main(){
  ios::sync_with_stdio(0);
  ll n,k;
  cin>>n>>k;
  ll l=1,r=n;
  while(1){
    while(r-l>=4*k+1){
      ll m=(l+r)/2;
      if(ask(l,m)){
        l=max(1LL,l-k);
        r=min(m+k,n);
      }else{
        l=max(1LL,m+1-k);
        r=min(r+k,n);
      }
    }
    ll x=rng()%(r-l+1)+l;
    if(ask(x,x))return 0;
    l=max(1LL,l-k);
    r=min(r+k,n);
  }
}


#include<bits/stdc++.h>
#define _ << " " <<
using namespace std;
using ll=long long;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int ask(ll l,ll r){
  cout<<l _ r<<endl;
  char str[4];
  cin>>str;
  if(str[0]=='B')exit(0);
  return str[0]=='Y';
}

int main(){
  ll n,k;
  cin>>n>>k;
  ll l=1,r=n;
  while(1){
    while(r-l>4*k){
      ll m=(l+r)/2;
      if(ask(l,m)){
        l=max(1LL,l-k);
        r=min(m+k,n);
      }else{
        l=max(1LL,m+1-k);
        r=min(r+k,n);
      }
    }
    ll x=rng()%(r-l)+l;
    if(ask(x,x))return 0;
    l=max(1LL,l-k);
    r=min(r+k,n);
  }
}


#include<bits/stdc++.h>
#define _ << " " <<
using namespace std;
using ll=long long;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int ask(ll l,ll r){
  cout<<l _ r<<endl;
  char str[4];
  cin>>str;
  if(str[0]=='B')exit(0);
  return str[0]=='Y';
}

int main(){
  ios::sync_with_stdio(0);
  ll n,k;
  cin>>n>>k;
  ll l=1,r=n;
  while(1){
    while(r-l+1>4*k){
      ll m=(l+r)/2;
      if(ask(l,m)){
        l=max(1LL,l-k);
        r=min(m+k,n);
      }else{
        l=max(1LL,m+1-k);
        r=min(r+k,n);
      }
    }
    ll x=rng()%(r-l+1)+l;
    if(ask(x,x))return 0;
    l=max(1LL,l-k);
    r=min(r+k,n);
  }
}


#include<bits/stdc++.h>
#define _ << " " <<
using namespace std;
using ll=long long;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

int ask(ll l,ll r){
  cout<<l _ r<<endl;
  char str[4];
  cin>>str;
  if(str[0]=='B')exit(0);
  return str[0]=='Y';
}

int main(){
  ios::sync_with_stdio(0);
  ll n,k;
  cin>>n>>k;
  ll l=1,r=n;
  while(1){
    while(r-l+1>4*k+1){
      ll m=(l+r)/2;
      if(ask(l,m)){
        l=max(1LL,l-k);
        r=min(m+k,n);
      }else{
        l=max(1LL,m+1-k);
        r=min(r+k,n);
      }
    }
    ll x=rng()%(r-l+1)+l;
    if(ask(x,x))return 0;
    l=max(1LL,l-k);
    r=min(r+k,n);
  }
}


#include<bits/stdc++.h>
#define _ << " " <<
using namespace std;
using ll=long long;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

int ask(ll l,ll r){
  cout<<l _ r<<endl;
  char str[4];
  cin>>str;
  if(str[0]=='B')exit(0);
  if(l==r&&str[0]=='Y')exit(0);
  return str[0]=='Y';
}

int main(){
  ios::sync_with_stdio(0);
  ll n,k;
  cin>>n>>k;
  ll l=1,r=n;
  while(1){
    while(r-l+1>4*k+1){
      ll m=(l+r)/2;
      if(ask(l,m)){
        l=max(1LL,l-k);
        r=min(m+k,n);
      }else{
        l=max(1LL,m+1-k);
        r=min(r+k,n);
      }
    }
    ll x=rng()%(r-l+1)+l;
    ask(x,x);
    l=max(1LL,l-k);
    r=min(r+k,n);
  }
}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == 'Yes')
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(r - l > 1) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		r += k;
		id++;
		if (r - l < 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(r - l > 1) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		r += k;
		id++;
		if (r - l < 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long

bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(r - l > 1) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
			fl = 1;
		} else {
			l = m;
		}
		l -= k;
		r += k;
		id++;
		if (r - l < 50 && id%2 == 0) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(id < 4500) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		id++;
		r += k;
		if (r - l <= 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long

bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(r - l > 1) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		l -= k;
		r += k;
		id++;
		if (r - l < 50 && id%2 == 0) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(id < 4500) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		id++:
		r += k;
		if (r - l <= 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	while(true) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		r += k;
		if (r - l <= 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(id < 4500) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		l = max(l, 1ll);
		id++;
		r += k;
		r = min(r, n + 1);
		if (r - l <= 4 * k + 5) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
			l = max(l, 1ll);
			r = min(r, n + 1);
			id++;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(id < 4500) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		l = max(l, 1ll);
		id++;
		r += k;
		r = min(r, n + 1);
		if (r - l <= 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		l = max(l, 1ll);
		r = min(r, n);
		id++;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(id < 4500) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		l = max(l, 1ll);
		id++;
		r += k;
		r = min(r, n + 1);
		if (r - l <= 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		l = max(l, 1ll);
		r = min(r, n + 1);
		id++;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	if (left == right && s == "Yes")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(id < 4500) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		l = max(l, 1ll);
		id++;
		r += k;
		r = min(r, n);
		if (r - l <= 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		l = max(l, 1ll);
		r = min(r, n);
		id++;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(r - l > 1) {
		int m = (l + r) / 2;
		if (l == r){
			ask(l, l);
			return 0;
		}
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		r += k;
		id++;
		if (r - l < 4 * k + 1) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		}
	}

}


//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
//
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;

#define int long long
bool kekw = 0;
bool ask(int left, int right) {
	cout << left << ' ' << right << endl;
	string s;
	cin >> s;
	if (s == "Bad")
		kekw = 1;
	return (s == "Yes");
}

signed main(){
	mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
	int n, k;
	cin >> n >> k;
	int l = 1, r = n + 1;
	int id = 0;
	while(r - l > 1) {
		int m = (l + r) / 2;
		if(ask(l, m)){
			r = m + 1;
		} else {
			l = m;
		}
		if (kekw)
			return 0;
		l -= k;
		r += k;
		id++;
		if (r - l < 50 && id%2 == 0) {
			int f = rnd()%(r - l) + l;
			if (ask(f, f)){
				return 0;
			}
			if (kekw)
				return 0;
			l -= k;
			r += k;
		}
	}

}