#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, long long int>> p;
long long int c;
void fun(vector<long long int>& b, long long int n, long long int k,
         long long int x) {
  if (c > n) return;
  if (x <= 0) return;
  if (k <= 0) return;
  vector<long long int> a;
  long long int sz = b.size();
  sz = min(k, sz);
  for (long long int i = 0; i < sz; i++) {
    for (long long int j = 0; j < k; j++) {
      p.push_back({b[i], c});
      a.push_back(c);
      c++;
      if (c > n) break;
    }
    if (c > n) break;
  }
  if (x >= 1 && c <= n && a.size() > 0) fun(a, n, k, x - 1);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, d, k;
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  vector<long long int> a(d + 1);
  for (long long int i = 0; i <= d; i++) a[i] = i + 1;
  c = d + 2;
  for (long long int i = 1; i < d + 1; i++) p.push_back({a[i - 1], a[i]});
  for (long long int i = 1; i < d; i++) {
    if (c > n) continue;
    long long int x = min(i, d + 1 - a[i]);
    if (x > 0) {
      long long int kk = k - 2;
      if (kk <= 0 || c > n) continue;
      vector<long long int> b;
      for (long long int j = 0; j < kk; j++) {
        p.push_back({a[i], c});
        b.push_back(c);
        c++;
        if (c > n) break;
      }
      x--;
      kk++;
      if (x > 0 && b.size() > 0 && kk > 0 && c <= n) fun(b, n, kk, x);
    }
  }
  if (c <= n) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (long long int i = 0; i < p.size(); i++) {
    cout << p[i].first << " " << p[i].second << endl;
  }
  return 0;
}
