#include <bits/stdc++.h>
using namespace std;
int intcmp(const void *v1, const void *v2) { return *(int *)v1 - *(int *)v2; }
int deep[400010];
vector<int> pathto[400010];
int n, d, k;
int ok = true;
int curi;
void doconnect(int i, int j) {
  pathto[i].push_back(j);
  pathto[j].push_back(i);
}
void buildi(int i) {
  int left = k - pathto[i].size();
  if (left < 0) {
    ok = false;
    return;
  }
  for (int j = 0; j < left; j++) {
    if (curi >= n + 1) return;
    int nowi = curi;
    curi++;
    doconnect(i, nowi);
    deep[nowi] = deep[i] - 1;
    if (deep[nowi] != 1) buildi(nowi);
  }
}
void dodump(int i) {
  for (auto item : pathto[i]) {
    if (item > i) {
      printf("%d %d\n", i, item);
    }
  }
}
int main() {
  cin >> n >> d >> k;
  curi = d + 2;
  for (int i = 1; i < d + 1; i++) {
    doconnect(i, i + 1);
    deep[i] = min(i, d + 2 - i);
  }
  deep[d + 1] = 1;
  for (int i = 2; i < d + 1; i++) {
    buildi(i);
  }
  if (n <= d) ok = false;
  if (curi != n + 1) ok = false;
  if (ok == false) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i < n + 1; i++) {
    dodump(i);
  }
  return 0;
}
