#include <bits/stdc++.h>
using namespace std;
struct Q {
  int a, b;
} A[400010];
int cnt = 1, x, c, d, k, n;
void build(int v, int m, int l) {
  if (x > n) return;
  if (l == 0) return;
  int i;
  for (i = 1; i <= m; i++) {
    A[cnt].a = v;
    A[cnt].b = x++;
    cnt++;
    if (x > n) return;
    build(x - 1, k - 1, l - 1);
    if (x > n) return;
  }
}
int main() {
  int i;
  cin >> n >> d >> k;
  if (k == 1) {
    if (d >= 2) {
      cout << "NO" << endl;
    } else {
      if (n != 2)
        cout << "NO" << endl;
      else {
        cout << "YES" << endl;
        cout << 1 << " " << 2 << endl;
      }
    }
    return 0;
  }
  if (d >= n) {
    cout << "NO" << endl;
    return 0;
  }
  x = 2;
  for (i = 1; i <= d; i++) {
    A[cnt].a = i;
    A[cnt].b = i + 1;
    cnt++;
    x++;
  }
  for (i = 2; i <= d; i++) {
    int mi = i - 1;
    if (mi > d + 1 - i) mi = d + 1 - i;
    build(i, k - 2, mi);
  }
  if (x <= n)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (i = 1; i < cnt; i++) cout << A[i].a << " " << A[i].b << endl;
  }
  return 0;
}
