#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 20;
const int INF = 1e9 + 7;
int n, d, k, num;
int a[N], b[N];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void dfs(int fa, int du, int son) {
  if (!du) return;
  for (register int i = 1, _r = son; i <= _r; ++i)
    if (num + 1 >= n)
      return;
    else
      a[++num] = fa, b[num] = num + 1, dfs(num + 1, du - 1, k - 1);
}
int main() {
  n = read(), d = read(), k = read();
  if (n <= d || (k == 1 && n > 2)) return puts("NO"), 0;
  for (register int i = 1, _r = d; i <= _r; ++i) a[++num] = i, b[num] = i + 1;
  for (register int i = 2, _r = d; i <= _r; ++i)
    dfs(i, min(i - 1, d + 1 - i), k - 2);
  if (num + 1 < n) return puts("NO"), 0;
  puts("YES");
  for (register int i = 1, _r = num; i <= _r; ++i)
    cout << a[i] << ' ' << b[i] << endl;
  return 0;
}
