#include <bits/stdc++.h>
using namespace std;
inline void read(int &X) {
  X = 0;
  int w = 0;
  char ch = 0;
  while (!isdigit(ch)) w |= ch == '-', ch = getchar();
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  X = w ? -X : X;
}
int n, d, k;
int a[400005], b[400005], cnt, tot;
void work(int x, int len, int deg) {
  if (!len) return;
  if (cnt == n - 1) return;
  for (int i = deg + 1; i <= k and cnt < n - 1; i++) {
    a[++cnt] = x;
    b[cnt] = ++tot;
    work(tot, len - 1, 1);
  }
}
signed main() {
  read(n);
  read(d);
  read(k);
  if (n == 2 and d == 1) {
    puts("YES");
    cout << 1 << " " << 2;
    return 0;
  }
  if (d >= n || k < 2) return puts("NO"), 0;
  for (int i = 1; i <= d; i++) a[++cnt] = i, b[cnt] = i + 1;
  tot = d + 1;
  for (int i = 2; i <= d and cnt < n - 1; i++)
    work(i, min(i - 1, d - i + 1), 2);
  if (cnt < n - 1) return puts("NO"), 0;
  puts("YES");
  for (int i = 1; i < n; i++) printf("%d %d\n", a[i], b[i]);
  return 0;
}
