#include <bits/stdc++.h>
using namespace std;
long long current, n, vert;
vector<pair<long long, long long> > myvec;
void create_tree(long long dis, long long d, long long k, long long curr,
                 long long deg) {
  if (dis == d || vert >= n - 1) {
    return;
  }
  long long i, val = curr;
  for (i = deg + 1; i <= k; i++) {
    myvec.push_back(make_pair(val, current));
    current++;
    vert++;
    create_tree((dis + 1), d, k, current - 1, 1);
  }
}
int main() {
  long long d, k, i, dis;
  cin >> n >> d >> k;
  vert = 0;
  if (d >= n || (k == 1 && n >= 2)) {
    cout << "NO\n";
    return 0;
  }
  for (i = 1; i <= d; i++) {
    myvec.push_back(make_pair(i, i + 1));
    vert++;
  }
  current = d + 2;
  for (i = 2; i <= d; i++) {
    if (vert >= n) break;
    dis = max(d + 1 - i, i - 1);
    create_tree(dis, d, k, i, 2);
  }
  if (vert < n - 1) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (i = 0; i < n - 1; i++) {
    cout << myvec[i].first << " " << myvec[i].second << endl;
  }
  myvec.clear();
  return 0;
}
