#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > edges;
void yes() {
  cout << "YES\n";
  for (int i = 0; i < edges.size(); i++) {
    cout << edges[i].first << " " << edges[i].second << "\n";
  }
  return;
}
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  if (d > n - 1) {
    cout << "NO\n";
    return 0;
  }
  if (k == 1 && n > 2) {
    cout << "NO\n";
    return 0;
  }
  vector<vector<int> > posible(d);
  vector<int> K(n + 1, k);
  for (int i = 0; i <= d; i++) {
    if (i != d) {
      pair<int, int> x(i + 1, i + 2);
      edges.push_back(x);
      K[i + 1]--;
      K[i + 2]--;
      int w = min(i, d - i);
      posible[w].push_back(i + 1);
    }
  }
  int act = d + 1;
  posible[0].push_back(d + 1);
  if (act == n) {
    yes();
    return 0;
  }
  for (int i = posible.size() - 1; i > 0; i--) {
    for (int j = 0; j < posible[i].size(); j++) {
      while (K[posible[i][j]] > 0) {
        pair<int, int> x(posible[i][j], act + 1);
        edges.push_back(x);
        K[posible[i][j]]--;
        K[act + 1]--;
        posible[i - 1].push_back(act + 1);
        act++;
        if (act == n) {
          yes();
          return 0;
        }
      }
    }
  }
  cout << "NO\n";
  return 0;
}
