#include <bits/stdc++.h>
using namespace std;
long long du[400005];
vector<pair<long long, long long> > p;
priority_queue<pair<long long, long long> > q;
int main() {
  long long n, d, k;
  cin >> n >> d >> k;
  if (n < d + 1) {
    cout << "NO" << endl;
    return 0;
  }
  for (long long i = 1; i <= d; i++) {
    du[i]++;
    du[i + 1]++;
    p.push_back({i, i + 1});
    long long v = min(i - 1, d + 1 - i);
    if (v) q.push({-v, i});
  }
  long long now = d + 2;
  while (q.size() && now <= n) {
    long long l = -q.top().first, x = q.top().second;
    q.pop();
    while (du[x] < k) {
      if (now > n) break;
      vector<long long> c;
      c.push_back(x);
      for (long long j = 1; j <= l; j++) {
        if (now > n) break;
        c.push_back(now);
        now++;
      }
      for (long long j = 0; j < c.size() - 1; j++) {
        du[c[j]]++;
        du[c[j + 1]]++;
        p.push_back({c[j], c[j + 1]});
        long long v = l - j;
        if (j && v) q.push({-v, c[j]});
      }
    }
  }
  long long tag = 0;
  for (long long i = 1; i <= n; i++) {
    if (du[i] > k) {
      tag = 1;
      break;
    }
  }
  if (now <= n) tag = 1;
  if (!tag) {
    cout << "YES" << endl;
    for (auto i : p) {
      cout << i.first << " " << i.second << endl;
    }
  } else {
    cout << "NO" << endl;
  }
}
