#include <bits/stdc++.h>
using namespace std;
int n, d, k;
int len[1000005];
int deg[1000005];
vector<pair<int, int> > e;
void ex() {
  printf("NO\n");
  exit(0);
}
int main() {
  scanf("%d %d %d", &n, &d, &k);
  if (n < d + 1) ex();
  for (int i = 2; i <= d + 1; i++) {
    e.push_back(make_pair(i - 1, i));
    deg[i - 1]++;
    deg[i]++;
  }
  for (int i = (d + 2) / 2 - 1; i >= 1; i--) len[i] = len[i + 1] + 1;
  for (int i = (d + 2) / 2 + 1; i <= d + 1; i++) len[i] = len[i - 1] + 1;
  queue<int> q;
  for (int i = d + 2; i <= n; i++) q.push(i);
  if (d % 2) {
    while (!q.empty() && deg[d] < k) {
      int v = q.front();
      q.pop();
      e.push_back(make_pair(d, v));
      deg[d]++;
      deg[v]++;
      len[v] = len[d] + 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i != (d + 2) / 2 && len[i] == 0) break;
    if (len[i] >= d / 2) continue;
    for (int j = deg[i]; j < k && !q.empty(); j++) {
      int v = q.front();
      q.pop();
      len[v] = len[i] + 1;
      deg[v]++;
      e.push_back(make_pair(i, v));
    }
  }
  if (!q.empty()) ex();
  printf("YES\n");
  for (pair<int, int> uv : e) printf("%d %d\n", uv.first, uv.second);
}
