#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
const int N = 500100;
int n, d, k, tn;
int g[N];
void dfs(int u, int cur, int mx, int cnt) {
  if (cur == mx) return;
  int id;
  for (int i = 1; i <= cnt; ++i) {
    ++tn;
    g[tn] = u;
    if (tn == n) {
      puts("YES");
      for (int i = 2; i <= n; ++i) printf("%d %d\n", i, g[i]);
      exit(0);
    }
    dfs(tn, cur + 1, mx, k - 1);
  }
}
int main() {
  n = read(), d = read(), k = read();
  if (d + 1 > n) {
    puts("NO");
    return 0;
  }
  if (n == 1) {
    if (d == 0)
      printf("YES");
    else
      printf("NO");
    return 0;
  }
  if (n == 2) {
    if (d == 1 && k >= 1)
      printf("YES\n2 1");
    else
      puts("NO");
    return 0;
  }
  if (k < 2) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= d; ++i) g[i + 1] = i;
  tn = d + 1;
  if (tn == n) {
    puts("YES");
    for (int i = 2; i <= n; ++i) printf("%d %d\n", i, g[i]);
    return 0;
  }
  if (d & 1) {
    int t = (d + 1) / 2;
    for (int i = 2; i <= t; ++i) dfs(i, 1, i, k - 2);
    for (int i = t + 1; i <= d; ++i) dfs(i, 1, (d + 1 - i + 1), k - 2);
  } else {
    int t = d / 2 + 1;
    for (int i = 2; i <= t; ++i) dfs(i, 1, i, k - 2);
    for (int i = t + 1; i <= d; ++i) dfs(i, 1, (d + 1 - i + 1), k - 2);
  }
  if (tn == n) {
    puts("YES");
    for (int i = 2; i <= n; ++i) printf("%d %d\n", i, g[i]);
  } else if (tn < n)
    puts("NO");
  return 0;
}
