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

#define gc getchar
#define rep(i,j,k) for(i=j; i<k; i++)
#define rrep(i,j,k) for(i=j; i>=k; i--)
#define repmat(i,j,n,m) for(i=0; i<n; i++) for(j=0; j<m; j++)
#define tr(c,it) for(auto it = (c).begin(); it != (c).end(); it++)
#define cinv(v,s,n) ll v_i; rep(v_i,s,n) cin>>v[v_i];
#define coutv(v,s,n) ll v_i; rep(v_i,s,n) cout<<v[v_i]<<" "; cout<<endl;
#define pb push_back 
#define all(c) (c).begin(),(c).end()
#define fin scan_int()
#define xx first
#define yy second
#define INOUT take_input_and_output_from_file();
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007
typedef long long ll;
typedef vector<ll > vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<string,ll > psi; 
typedef pair<ll ,ll > pii;

#define strtoint(s,n) if (!(istringstream(s) >> n) ) n = 0;
string inttostr(ll str){stringstream stream; stream << str; return stream.str();}
string numtobin(ll n) {string r = "";while(n) r = ((n&1) ? '1' : '0') + r, n >>= 1;return r;}
ll bintonum(string s) {ll n=0, p=1<<(s.length()-1);for(char i : s) n += (i-'0')*p, p>>=1;return n;}
ll modexpo(ll a,ll b,ll n){ll d=1;while(b){if(b&1)d=(d*a)%n;b>>=1;a=(a*a)%n;}return d;}
ll expo(ll a,ll b){ll d=1;while(b){if(b&1)d=d*a;b>>=1;a=a*a;}return d;}
inline ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
inline ll lcm(ll a, ll b) {return (a*b)/gcd(a,b);}
ll inv(ll a,ll m) {return modexpo(a,m-2,m);}
void take_input_and_output_from_file() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}
inline ll scan_int() {
    ll NR=0,sign=1;
    char c=gc();
    while( c < 48 || c > 57 ) {
        if(c=='-') sign=0;
        c=gc();
    }
    while(c>47 && c< 58) {
        NR = (NR << 3) + (NR << 1) + (c - 48);
        c=gc();
    }
    return (sign?NR:(-NR));
}

////////////////////////////////////////////////////////////////////////////////////////////


vi g[100005];

int depth(int n) {
    int d=0, i;
    rep(i,0,g[n].size()) {
        d = max(d, 1 + depth(g[n][i]));
    }
    return d;
}

int main(){
    //INOUT;

    int n=fin, d=fin, k=fin;

    if(n == 1) {
        cout<<"YES"<<endl;
        cout<<1<<endl;
        return 0;
    }

    int h[n+1] = {0};
    int p[n+1];
    int i, j;

    rep(i,0,n+1) p[i]=i; 

    queue<int > q;
    rep(i,2,min(k+2,n+1)) {
        q.push(i);
        g[1].pb(i);
        p[i] = 1;
        h[i] = 1;
    }

    while(!q.empty()) {
        int f = q.front();
        q.pop();
        rep(j,i,min(n+1,i+k-1)) {
            g[f].pb(j);
            p[j] = f;
            h[j] = h[f]+1;
            q.push(j);
        }
        i=j;
    }

    // rep(i,1,n+1) {
    //     cout<<i<<" : "; 
    //     rep(j,0,g[i].size()) 
    //         cout<<g[i][j]<<" "; cout<<endl;
    // }

    int de[g[1].size()];
    rep(i,0,g[1].size()) {
        de[i] = depth(g[1][i]);
    }

    // rep(i,0,g[1].size()) cout<<g[1][i]<<" "<<de[i]<<endl;
    int md=de[0], smd=0, mdi=0;
    rep(i,1,g[1].size()) {
        if(de[i] > md) {
            md = de[i];
            mdi = i;
        }
    }
    rep(i,0,g[1].size()) {
        if(i != mdi) {
            smd = max(smd, de[i]);
        }
    }

    // cout<<md<<" "<<smd<<endl;

    if(md+smd+2 > d) {
        cout<<"NO"<<endl;
    }
    else {
        cout<<"YES"<<endl;
        rep(i,1,n+1) {
            if(g[i].size()) {
                rep(j,0,g[i].size()) {
                    cout<<i<<" "<<g[i][j]<<endl;
                }
            }
        }
    }

    return 0;
}