#include <bits/stdc++.h>
using namespace std;
struct node {
  int f;
} p[1000000];
int cnt = 2, n, ma;
int qp(int d, int c, int tar) {
  if (c == 1) return d;
}
void build(int rt, int sn, int maxd) {
  if (maxd == 0) return;
  int tmp = 0;
  for (int i = 0; i < sn; i++) {
    p[cnt + 1].f = rt;
    build(++cnt, sn, maxd - 1);
    if (cnt >= n) return;
  }
  return;
}
int main() {
  int d, k;
  scanf("%d%d%d", &n, &d, &k);
  if (n == 1) {
    printf("YES");
    return 0;
  }
  p[2].f = 1;
  build(2, k - 1, (d + 1) / 2 - 1);
  for (int i = 2; i <= min(k, n - 1); i++) {
    cnt++;
    p[cnt].f = 1;
    build(cnt, k - 1, d / 2 - 1);
  }
  if (cnt >= n) {
    printf("YES\n");
    for (int i = 2; i <= n; i++) {
      printf("%d %d\n", i, p[i].f);
    }
  } else
    printf("NO");
  return 0;
}
