#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, d, k, i;
  cin >> n >> d >> k;
  array<int, 40001> deg;
  array<int, 40001> dist;
  vector<pair<int, int>> edges;
  vector<int> verts;
  deg.fill(0);
  dist[1] = d;
  for (i = 1; i <= d; ++i) {
    edges.push_back(make_pair(i, i + 1));
    ++deg[i];
    ++deg[i + 1];
    if (i != 1) dist[i] = max(d + 1 - i, i - 1);
    if (dist[i] < d) verts.push_back(i);
  }
  dist[i] = d;
  ++i;
  while (verts.size()) {
    vector<int> verts2;
    for (int j : verts) {
      while (i <= n && deg[j] < k && dist[j] < d) {
        ++deg[j];
        ++deg[i];
        dist[i] = dist[j] + 1;
        edges.push_back(make_pair(i, j));
        if (dist[i] < d) verts2.push_back(i);
        ++i;
      }
      if (i == n) break;
    }
    if (i == n) break;
    verts = verts2;
  }
  if (i == n + 1) {
    cout << "YES\n";
    for (int j = 0; j < edges.size(); ++j) {
      cout << edges[j].first << " " << edges[j].second << '\n';
    }
  } else {
    cout << "NO\n";
  }
  return 0;
}
