#include <bits/stdc++.h>
using namespace std;
vector<long long> tu[400005];
struct awsl {
  long long a, b;
} deep[400005];
long long vis[400005];
long long poww(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
int main() {
  long long n, d, k, num, cou, x;
  cin >> n >> d >> k;
  x = d + 1;
  if (n == 1) {
    cout << "NO\n";
    return 0;
  }
  if (n == 2) {
    if (d == 1) {
      cout << "YES\n";
      cout << 1 << " " << 2 << '\n';
    } else
      cout << "NO\n";
    return 0;
  }
  if (k == 2) {
    if (n != d + 1)
      cout << "NO\n";
    else {
      cout << "YES\n";
      for (int i = 1; i < n; i++) {
        cout << i << " " << i + 1 << '\n';
      }
    }
    return 0;
  }
  if (k == 1) {
    cout << "NO\n";
    return 0;
  }
  if (n <= d) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    tu[i].push_back(i + 1);
    tu[i + 1].push_back(i);
    deep[i].a = i - 1, deep[i].b = d - i + 1;
    deep[i + 1].a = i, deep[i + 1].b = d - (i + 1) + 1;
  }
  num = d + 2;
  for (int i = 2; num <= n && i <= n; i++) {
    if (deep[i].a >= d || deep[i].b >= d) continue;
    for (int j = 1; j <= k - 2 && num <= n; j++) {
      tu[i].push_back(num);
      tu[num].push_back(i);
      deep[num].a = deep[i].a + 1;
      deep[num].b = deep[i].b + 1;
      if (i == num) {
        cout << "NO\n";
        return 0;
      }
      num++;
      for (int p = max(deep[i].a, deep[i].b); p < d - 1 && num <= n; p++) {
        tu[num].push_back(num - 1);
        tu[num - 1].push_back(num);
        deep[num].a = deep[num - 1].a + 1;
        deep[num].b = deep[num - 1].b + 1;
        num++;
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < tu[i].size(); j++) {
      if (vis[i] && vis[tu[i][j]]) continue;
      cout << i << " " << tu[i][j] << '\n';
      vis[i]++, vis[tu[i][j]]++;
    }
  }
}
