#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  d++;
  if (d > n) {
    cout << "NO";
    exit(0);
  }
  if (n > 2 && k == 1) {
    cout << "NO";
    exit(0);
  }
  if ((d - 2) * (k - 2) + d < n) {
    cout << "NO";
    exit(0);
  }
  cout << "YES" << endl;
  for (int i = 1; i < d; i++) cout << i << ' ' << i + 1 << endl;
  int curr = d + 1;
  int root = 2;
  while (curr <= n) {
    int perm = 2;
    while (curr <= n && perm < k) {
      cout << curr << ' ' << root << endl;
      curr++;
      perm++;
    }
    root++;
  }
}
