#include <bits/stdc++.h>
using namespace std::chrono;
using namespace std;
bool IOerror = 0;
inline char nc() {
  static char buf[1000000], *p1 = buf + 1000000, *pend = buf + 1000000;
  if (p1 == pend) {
    p1 = buf;
    pend = buf + fread(buf, 1, 1000000, stdin);
    if (pend == p1) {
      IOerror = 1;
      return -1;
    }
  }
  return *p1++;
}
inline bool blank(char ch) {
  return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
}
inline int getint() {
  int x = 0;
  char ch;
  int sgn = 1;
  while (blank(ch = nc()))
    ;
  if (IOerror) return 0;
  if (ch == '-') sgn = -1, ch = nc();
  for (x = ch - '0'; (ch = nc()) >= '0' && ch <= '9'; x = x * 10 + ch - '0')
    ;
  return x * sgn;
}
inline long long getll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline double getdb() {
  static double x;
  scanf("%lf", &x);
  return x;
}
template <typename T>
void updmax(T& a, T const& b) {
  a = max(a, b);
}
template <typename T>
void updmin(T& a, T const& b) {
  a = min(a, b);
}
template <typename T>
int Descr(T* from, T* to) {
  sort(from, to);
  return (int)(unique(from, to) - from);
}
template <typename T>
int LBound(T* from, T* to, T const& val) {
  return (int)(lower_bound(from, to, val) - from);
}
template <typename T>
int UBound(T* from, T* to, T const& val) {
  return (int)(upper_bound(from, to, val) - from);
}
time_point<system_clock> timing;
void TimingBegin() { timing = system_clock::now(); }
void TimingEnd(const char* c = "time:") {
  auto end = system_clock::now();
  auto d = duration_cast<microseconds>(end - timing);
  printf("%s %.10f\n", c,
         double(d.count()) * microseconds::period::num /
             microseconds::period::den);
}
void TimingTick(const char* c = "time:") {
  TimingEnd(c);
  TimingBegin();
}
void bout(int x) {
  while (x) printf("%d", x & 1), x >>= 1;
}
const int mxn = 405000;
int n, d, k, cur, cnt;
int pa[mxn], pb[mxn];
void addedge(int a, int b) {
  pa[cnt] = a;
  pb[cnt] = b;
  cnt++;
}
void DFS(int x, int dep, int deg) {
  if (dep != 0 && cur < n)
    for (int i = 1, lim__lim = (deg); i <= lim__lim; i++)
      if (cur < n) {
        int v = ++cur;
        DFS(v, dep - 1, k - 1);
        addedge(x, v);
      }
}
int main() {
  scanf("%d%d%d", &n, &d, &k);
  for (int i = 1, lim__lim = (d); i <= lim__lim; i++) addedge(i, i + 1);
  cur = d + 1;
  if (cur > n) {
    printf("NO");
    return 0;
  }
  for (int i = 2, lim__lim = (d); i <= lim__lim; i++) {
    DFS(i, min(i - 1, d - i + 1), k - 2);
  }
  if (cur < n) {
    printf("NO");
    return 0;
  }
  printf("YES\n");
  for (int i = 0, lim__lim = (cnt - 1); i <= lim__lim; i++) {
    printf("%d %d\n", pa[i], pb[i]);
  }
  return 0;
}
