#include <bits/stdc++.h>
using namespace std;
int drvo(int koren, int visina, int is, int n) {
  if (visina == 1 || koren == n) return (koren + 1);
  int t = koren + 1, i;
  for (i = 0; i < is; i++) {
    printf("%d %d\n", koren, t);
    t = drvo(t, visina - 1, is, n);
    if (t == n + 1) break;
  }
  return (t);
}
long long stepen(long long x, int y) {
  if (y == 1 || x > 10000000000) return (x);
  long long sol;
  if (y % 2)
    sol = x * stepen(x, y - 1);
  else {
    sol = stepen(x, y / 2);
    if (sol < 100000)
      sol *= sol;
    else
      sol = 10000000001;
  }
  return (sol);
}
int main() {
  int n, d, k, i, j, t, tmp;
  scanf("%d%d%d", &n, &d, &k);
  if (n < d + 1)
    printf("NO\n");
  else {
    if (d == 1) {
      if (n <= 2) {
        printf("YES\n");
        if (n == 2) printf("1 2\n");
      } else
        printf("NO\n");
      return (0);
    }
    if (k == 1) {
      printf("NO\n");
      return (0);
    }
    int jaja = (d % 2) ? ((d - 3) / 2) : ((d - 2) / 2), is = k - 1;
    long long kapa = 1, po = stepen(is, jaja + 1);
    if (is > 1)
      kapa += k * (po - 1) / (is - 1);
    else
      kapa += k * (jaja + 1);
    if (d % 2) kapa += po;
    if (kapa < n)
      printf("NO\n");
    else {
      printf("YES\n");
      for (i = 1; i <= d; i++) printf("%d %d\n", i, i + 1);
      t = d + 2;
      i = 2;
      tmp = (d + 2) / 2;
      while (t <= n && i <= tmp) {
        j = 3;
        while (j <= k && t <= n) {
          printf("%d %d\n", i, t);
          t = drvo(t, i - 1, k - 1, n);
          j++;
        }
        i++;
      }
      i = d;
      while (t <= n && i > tmp) {
        j = 3;
        while (j <= k && t <= n) {
          printf("%d %d\n", i, t);
          t = drvo(t, d - i + 1, k - 1, n);
          j++;
        }
        i--;
      }
    }
  }
  return 0;
}
