#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int u, v;
} edge[400005];
int en;
int degree[400005];
int dist[400005];
int ncnt;
int n, d, k;
void go(int cur, int bef_s, int bef_e) {
  if (bef_s > bef_e) return;
  int nbs = 1e9, nbe = 0;
  for (int i = bef_s; i <= bef_e; i++) {
    while (degree[i] < k) {
      if (ncnt >= n) return;
      degree[i]++;
      degree[cur]++;
      dist[cur] = dist[i] + 1;
      if (dist[cur] + 1 <= d) {
        nbs = min(nbs, cur);
        nbe = max(nbe, cur);
      }
      edge[en++] = {i, cur++};
      ncnt++;
    }
  }
  go(cur, nbs, nbe);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> d >> k;
  if (k == 1) {
    if (n == 2 && d == 1) {
      cout << "NO";
      return 0;
    }
  }
  if (n <= d) {
    cout << "NO";
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    edge[en++] = {i, i + 1};
    degree[i]++, degree[i + 1]++;
    dist[i] = max(abs(1 - i), abs(d + 1 - i));
    ncnt++;
  }
  ncnt++;
  go(d + 2, 2, d);
  if (ncnt < n) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < en; i++) {
    cout << edge[i].u << " " << edge[i].v << "\n";
  }
  return 0;
}
