#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 5;
vector<int> son[maxn];
int n, d, k, cnt, dep[maxn], now, ovo;
int fa[maxn];
int main() {
  cin >> n >> d >> k;
  int depmax = d / 2 + 1;
  now = 1, fa[1] = 1, dep[1] = 1;
  for (register int i = 2; i <= depmax + d % 2; ++i) {
    if (son[i - 1].size() + (i - 1 != 1) < k && fa[i - 1] &&
        (dep[i - 1] < depmax || son[i - 1].size())) {
      son[i - 1].push_back(i);
      fa[i] = i - 1;
      dep[i] = dep[fa[i]] + 1;
    }
  }
  cnt = depmax + d % 2 + 1;
  if (son[1].size() < k && fa[1] && (dep[1] < depmax || son[1].size())) {
    son[fa[cnt] = 1].push_back(cnt);
    dep[cnt] = dep[1] + 1;
  }
  if (cnt > n + 1) return printf("NO"), 0;
  for (register int i = 1; i <= depmax - 2; ++i) {
    if (cnt + i > n) return printf("NO"), 0;
    if (son[cnt + i - 1].size() + (cnt + i - 1 != 1) < k && fa[cnt + i - 1] &&
        (dep[cnt + i - 1] < depmax || son[cnt + i - 1].size())) {
      son[fa[cnt + i] = cnt + i - 1].push_back(cnt + i);
      dep[cnt + i] = dep[cnt + i - 1] + 1;
    }
  }
  for (register int i = 1; i <= n + 1; ++i)
    if (!fa[i]) {
      cnt = i;
      break;
    }
  while (cnt <= n && now <= n) {
    if (son[now].size() + (now != 1) < k && fa[now] &&
        (dep[now] < depmax || son[now].size())) {
      son[now].push_back(cnt);
      fa[cnt] = now;
      dep[cnt] = dep[fa[cnt]] + 1;
      cnt++;
    } else
      now++;
  }
  if (cnt <= n) return printf("NO"), 0;
  puts("YES");
  for (register int i = 2; i <= n; ++i) printf("%d %d\n", fa[i], i);
  return 0;
}
