#include <bits/stdc++.h>
using namespace std;
int kol, used;
int k;
void go(int v, int ost, int len) {
  if (len == 0 || kol == 0) return;
  for (int i = 1; i <= ost; i++) {
    used++;
    cout << v << " " << used << endl;
    kol--;
    if (kol == 0) return;
    go(used, k - 1, len - 1);
  }
}
int main() {
  int n, d;
  cin >> n >> d >> k;
  if (k == 1) {
    if (n == 2 && d == 1) {
      cout << "YES" << endl;
      cout << 1 << " " << 2 << endl;
      return 0;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (n <= d) {
    cout << "NO" << endl;
    return 0;
  }
  long long ww = d + 1;
  long long last = 0;
  long long long long = 0;
  for (int i = 2; i <= d; i++) {
    if (i == 2) {
      ww += (k - 2);
      if (ww >= n) break;
      long long = k - 2;
      if (d + 1 - i + 1 > i)
        ww += (k - 2);
      else
        break;
      if (ww >= n) break;
      last = k - 2;
    } else {
      long long += (last * (k - 1));
      ww += long long;
      if (ww >= n) break;
      if (d + 1 - i + 1 > i)
        ww += long long;
      else
        break;
      last *= (k - 1);
      if (ww >= n) break;
    }
  }
  if (n > ww) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  kol = n - d - 1;
  used = d + 1;
  for (int i = 1; i <= d; i++) {
    cout << i << " " << i + 1 << endl;
  }
  for (int i = 2; i <= d; i++) {
    go(i, k - 2, min(i - 1, d - i + 1));
  }
  return 0;
}
