#include <bits/stdc++.h>
using namespace std;
long long modexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long expo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i += 6) {
    if ((n % i == 0) || (n % (i + 2) == 0)) return false;
  }
  return true;
}
long double dist(long long x1, long long y1, long long x2, long long y2) {
  return (long double)sqrt(
      (long double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}
long long squaredist(long long x1, long long y1, long long x2, long long y2) {
  return ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
long long nCr(long long n, long long r) {
  if (r == 0) return 1;
  return (n * nCr(n - 1, r - 1)) / r;
}
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  if (d >= 2 && k == 1) {
    cout << "NO" << endl;
  } else if ((d + 1) > n)
    cout << "NO" << endl;
  else if (d == 1 && ((n > 2) || (n == 1)))
    cout << "NO" << endl;
  else if (d == 1 && n == 2) {
    cout << "YES\n";
    cout << 1 << " " << 2 << endl;
  } else {
    vector<pair<long long, long long>> arr;
    vector<long long> deg(n + 1, 0);
    vector<long long> level(n + 1, 0);
    vector<long long> pr;
    for (int i = 2; i <= d + 1; i++) {
      arr.push_back(make_pair(i - 1, i));
      deg[i - 1] += 1;
      deg[i] += 1;
    }
    for (int i = 1; i <= d + 1; i++) level[i] = max(i - 1, d + 1 - i);
    for (int i = 2; i <= d; i++) pr.push_back(i);
    int x = d + 2;
    for (int i = 0; i < pr.size(); i++) {
      int curr_level = d + 1 - level[pr[i]];
      if (x > n) {
        break;
      }
      if (curr_level <= 0) continue;
      while ((deg[pr[i]] < k) && x <= n) {
        deg[x]++;
        deg[pr[i]]++;
        arr.push_back(make_pair(x, pr[i]));
        level[x] = level[pr[i]] + 1;
        if (level[x] < d) pr.push_back(x);
        x++;
      }
    }
    if (x <= n) {
      cout << "NO\n";
      return 0;
    }
    cout << "YES\n";
    for (int i = 0; i < arr.size(); i++)
      cout << arr[i].first << " " << arr[i].second << endl;
  }
  return 0;
}
