#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, d, k;
  cin >> n >> d >> k;
  if (d >= n || (n > 2 && k < 2)) {
    cout << "NO" << endl;
    return 0;
  }
  vector<pair<int, int> > e;
  vector<int> deg(n + 1, 0), d1(n + 1, 0), d2(n + 1, 0);
  d1[1] = 0, d2[1] = d;
  d1[d + 1] = d;
  d2[d + 1] = 0;
  queue<int> q;
  for (int i = 1; i <= d; i++) {
    e.push_back(make_pair(i, i + 1));
    deg[i]++, deg[i + 1]++;
    d1[i] = i - 1;
    d2[i] = d + 1 - i;
    if (i > 1 && deg[i] < k) q.push(i);
  }
  int x = d + 2;
  while (!q.empty() && x <= n) {
    int temp = q.front();
    q.pop();
    if (d1[temp] < d && d2[temp] < d) {
      d1[x] = d1[temp] + 1;
      d2[x] = d2[temp] + 1;
      e.push_back(make_pair(temp, x));
      deg[x]++;
      deg[temp]++;
      if (deg[temp] < k) q.push(temp);
      if (deg[x] < k) q.push(x);
      x++;
    }
  }
  if ((int)e.size() != n - 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < e.size(); i++)
      cout << e[i].first << " " << e[i].second << endl;
  }
  return 0;
}
