#include <bits/stdc++.h>
const int MAXN = 4e5;
const int MAXM = 8e5;
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char c = ' ';
  while (!isdigit(c)) {
    c = getchar();
    if (c == '-') w = -1;
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x * w;
}
struct Edge {
  int to, nxt;
  Edge() {}
  Edge(int _to, int _nxt) : to(_to), nxt(_nxt) {}
} edge[MAXM + 5];
int rt, tot, head[MAXN + 5], deg[MAXN + 5];
int depth[MAXN + 5], fa[MAXN + 5];
inline void AddEdge(int u, int v) {
  edge[tot] = Edge(v, head[u]);
  head[u] = tot++;
  edge[tot] = Edge(u, head[v]);
  head[v] = tot++;
  ++deg[u], ++deg[v];
}
int n, d, k, mx, mx2, cur;
void dfs(int u) {
  if (cur >= n) return;
  if (depth[u] == mx2) return;
  while (deg[u] < k && cur < n) {
    ++cur, AddEdge(u, cur);
    fa[cur] = u, depth[cur] = depth[u] + 1;
  }
  for (int i = head[u]; ~i; i = edge[i].nxt) {
    int v = edge[i].to;
    if (v != fa[u]) dfs(v);
  }
}
void init() {
  tot = 0;
  memset(head, -1, sizeof(head));
  n = read();
  d = read();
  k = read();
}
int main() {
  init();
  if (d + 1 > n) {
    puts("NO");
    return 0;
  } else if (d + 1 == n) {
    for (int i = 1; i < n; ++i) printf("%d %d\n", i, i + 1);
    return 0;
  }
  mx = (d + 1) / 2;
  mx2 = d - mx;
  rt = 1;
  for (int i = 2; i <= mx + 1; ++i) {
    AddEdge(i - 1, i);
    depth[i] = i - 1, fa[i] = i - 1;
  }
  AddEdge(rt, mx + 2), depth[mx + 2] = 1, fa[mx + 2] = rt;
  for (int i = mx + 3; i <= mx + mx2 + 1; ++i) {
    AddEdge(i - 1, i);
    depth[i] = depth[i - 1] + 1, fa[i] = i - 1;
  }
  cur = d + 1;
  for (int i = 1; i <= cur; ++i) {
    if (deg[i] > k) {
      puts("NO");
      return 0;
    }
  }
  dfs(rt);
  if (cur < n) {
    int u = fa[mx + 1];
    while (fa[u] && cur < n) {
      while (deg[u] < k && cur < n) {
        ++cur, AddEdge(u, cur);
        fa[cur] = u, depth[cur] = depth[u] + 1;
      }
      u = fa[u];
    }
  }
  if (cur < n) {
    puts("NO");
  } else {
    puts("YES");
    for (int i = 0; i < tot; i += 2) {
      printf("%d %d\n", edge[i].to, edge[i ^ 1].to);
    }
  }
  return 0;
}
