#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vec;
int cur, n;
void solve(int k, int rem) {
  cur--;
  int x = cur;
  cur++;
  for (int i = 0; i < k; ++i) {
    if (cur > n) return;
    vec.push_back({x, cur++});
    if (rem - 1) solve(k, rem - 1);
  }
}
int main() {
  int d, k;
  cin >> n >> d >> k;
  d++;
  if (d > n) return puts("NO");
  if (n == 2) {
    cout << "YES" << endl;
    cout << "1 2" << endl;
    return 0;
  }
  if (k < 2 || d == 2) return puts("NO");
  for (int i = 1; i < d; ++i) {
    vec.push_back({i, i + 1});
  }
  if (k == 2) {
    if (n != d) return puts("NO");
  } else {
    cur = d + 1;
    int can = 1;
    int add = 1;
    int m = (d + 1) / 2;
    bool lim = d % 2;
    for (int i = 2; i < d; ++i) {
      int a = k - 2;
      while (cur <= n && a > 0) {
        vec.push_back({i, cur++}), a--;
        if (can - 1) {
          solve(k - 1, can - 1);
        }
      }
      if (i == m) add *= -1;
      can += add;
      if (!lim && add < 0) can++, lim = 1;
    }
    if (cur < n + 1) return puts("NO");
  }
  cout << "YES" << endl;
  for (int i = 0; i < vec.size(); ++i)
    printf("%d %d\n", vec[i].first, vec[i].second);
  return 0;
}
