#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  vector<vector<int> > distance(d);
  vector<bool> nice(n, false);
  vector<pair<int, int> > edges;
  distance[0].push_back(1);
  nice[2] = true;
  int act = 2;
  for (int i = 0; i < k; i++) {
    pair<int, int> x(1, act);
    edges.push_back(x);
    distance[1].push_back(act);
    act++;
    if (act == n + 1) {
      cout << "YES\n";
      for (int i = 0; i < n - 1; i++) {
        cout << edges[i].first << " " << edges[i].second << "\n";
      }
      return 0;
    }
  }
  int t = 2;
  while (2 * t <= d) {
    for (int i = 0; i < distance[t - 1].size(); i++) {
      int r = distance[t - 1][i];
      for (int j = 1; j < k; j++) {
        if (nice[r] == true) {
          nice[act] = true;
        }
        pair<int, int> x(r, act);
        edges.push_back(x);
        distance[t].push_back(act);
        act++;
        if (act == n + 1) {
          cout << "YES\n";
          for (int i = 0; i < n - 1; i++) {
            cout << edges[i].first << " " << edges[i].second << "\n";
          }
          return 0;
        }
      }
    }
    t++;
  }
  if (d % 2 == 1) {
    for (int i = 0; i < distance[t - 1].size(); i++) {
      int r = distance[t - 1][i];
      for (int i = 1; i < k; i++) {
        if (nice[r] == true) {
          pair<int, int> x(r, act);
          edges.push_back(x);
          distance[t].push_back(act);
          act++;
          if (act == n + 1) {
            cout << "YES\n";
            for (int i = 0; i < n - 1; i++) {
              cout << edges[i].first << " " << edges[i].second << "\n";
            }
            return 0;
          }
        }
      }
    }
  }
  cout << "NO\n";
  return 0;
}
