#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int n, d, k, nxt, cnt = 0;
vector<pair<int, int> > edges;
void add_edges(int v, int togo) {
  if (togo == 0) return;
  int degree;
  if (v <= d + 2)
    degree = 2;
  else
    degree = 1;
  while (degree < k && cnt > 0) {
    edges.push_back({v, nxt});
    cnt--;
    add_edges(nxt++, togo - 1);
    degree++;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> n >> d >> k;
  if (n - 1 < d) return cout << "NO\n", 0;
  if (n - 1 == d) {
    if (d != 1 && k == 1) return cout << "NO\n", 0;
    cout << "YES\n";
    for (int i = 1; i < n; i++) cout << i << " " << i + 1 << "\n";
    return 0;
  } else {
    for (int i = 1; i <= d; i++) edges.push_back({i, i + 1});
    cnt = n - d - 1;
    nxt = d + 2;
    int cur = 2, deg = 1;
    while (cur <= d) {
      int mx = min(d - cur + 1, cur - 1);
      add_edges(cur, mx);
      cur++;
    }
    if ((int)edges.size() != n - 1) return cout << "NO\n", 0;
    cout << "YES\n";
    for (auto p : edges) cout << p.first << " " << p.second << "\n";
  }
  return 0;
}
