#include <bits/stdc++.h>
using namespace std;
int scanst(char *a) {
  int i = 0;
  char c = 0;
  while (c < 33) c = getchar();
  while (c > 33) {
    a[i++] = c;
    c = getchar();
  }
  a[i] = 0;
  return i;
}
template <typename T>
bool scan(T &n) {
  n = 0;
  bool got = false;
  bool negative = false;
  char c = getchar();
  if (c == EOF) return false;
  while (c<'0' | c> '9') {
    if (c == '-') negative = true;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    got = true;
    n = n * 10 + c - 48;
    c = getchar();
  }
  if (negative) n = ~(n - 1);
  return got;
}
template <typename T>
inline T GCD(T a, T b) {
  a = abs(a);
  b = abs(b);
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
template <typename T>
inline T LCM(T x, T y) {
  T tp = GCD(x, y);
  if ((x / tp) * 1. * y > 9e18) return 9e18;
  return (x / tp) * y;
}
template <typename T>
inline T BigMod(T A, T B, T M) {
  T ret = 1;
  while (B) {
    if (B & 1) ret = (ret * A) % M;
    A = (A * A) % M;
    B = B >> 1;
  }
  return ret;
}
template <typename T>
inline T InvMod(T A, T M) {
  return BigMod(A, M - 2, M);
}
int gcdr(int a, int b) {
  if (a == 0) return b;
  return gcdr(b % a, a);
}
void FastIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
}
long long n, depth, edge, used;
vector<long long> G[400005];
long long edges[400005] = {0}, de[400004] = {0};
void build(long long current, long long d, long long e) {
  for (long long i = e; i < edge; i++) {
    if ((d + 1) <= depth && (used + 1) <= n) {
      used++;
      G[current].push_back(used);
      edges[used]++;
      edges[current]++;
      build(used, d + 1, edges[used]);
    }
  }
}
int main() {
  FastIO();
  long long p, q, i, j;
  while (cin >> n >> depth >> edge) {
    if (depth >= n) {
      cout << "NO" << endl;
    }
    used = 1;
    de[used] = depth - 1;
    long long high = depth - 2;
    for (i = 1; i < depth; i++) {
      G[used].push_back(used + 1);
      edges[used]++;
      edges[used + 1]++;
      de[used + 1] = max(i, high);
      high--;
      used++;
    }
    long long sz = used;
    for (i = sz; i > 1; i--) {
      build(i, de[i], edges[i]);
    }
    if (used == n) {
      cout << "YES" << endl;
      for (i = 1; i <= n; i++) {
        for (j = 0; j < G[i].size(); j++) {
          cout << i << " " << G[i][j] << endl;
        }
      }
    } else {
      cout << "NO" << endl;
    }
  }
}
