#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 4 * (1e5 + 10);
int n, nV, d, k, id[MAXN], mark[MAXN];
vector<pair<int, int> > tree;
void create_Edge(int u, int v) { tree.push_back({u, v}); }
bool build(int v, int s) {
  int davez = s;
  for (int i = 1; i <= s; i++) {
    if (nV == n) return 0;
    create_Edge(davez, ++nV), davez = nV;
    id[nV] = i > ceil(s / 2) ? s - i : i - 1;
  }
  return 1;
}
int main() {
  scanf("%d %d %d", &n, &d, &k);
  if (n < d - 1) {
    puts("NO");
    return 0;
  }
  memset(id, -1, sizeof id);
  memset(mark, 0, sizeof mark);
  for (int i = 1; i <= d - 1; i++) tree.push_back({i, i + 1});
  nV = d - 1;
  for (int i = 2; i < nV; i++) {
    mark[i] = 1;
    if (!build(i, (i > ceil(nV / 2) ? nV - i : i - 1))) goto out;
  }
  for (int i = 1; i <= nV; i++) {
    if (mark[i]) continue;
    build(i, id[i]);
  }
  for (int i = 1; i <= nV; i++) {
    if (i == 1 or i == d - 1) continue;
    for (int x = 0; x <= k - 1; x++) {
      if (nV == n) goto out;
      create_Edge(i, ++nV);
    }
  }
  if (nV != n) {
    puts("NO");
    return 0;
  }
out:
  puts("YES");
  for (int i = 0; i < tree.size(); i++)
    printf("%d %d\n", tree[i].first, tree[i].second);
}
