#include <bits/stdc++.h>
using namespace std;
const int MX = 105;
const int MOD = 1000000007;
struct Data {
  int node, more, hand;
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, d, k;
  cin >> n >> d >> k;
  vector<pair<int, int> > ans;
  vector<Data> use;
  if (d + 1 > n) {
    cout << "NO" << endl;
    return 0;
  }
  if ((k == 1 && d > 1) || (k == 2 && n > d + 1)) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    ans.push_back(pair<int, int>(i, i + 1));
  }
  for (int i = 2; i <= d; i++) use.push_back({i, min(i - 1, d - i + 1), 2});
  int taken = d + 1, need = 3;
  while (taken < n && need <= k) {
    for (int i = 0; i < use.size(); i++) {
      for (int j = use[i].hand; j < need && taken < n; j++) {
        use[i].hand++;
        ans.push_back(pair<int, int>(use[i].node, ++taken));
        if (use[i].more > 1) use.push_back({taken, use[i].more - 1, 1});
      }
    }
    need++;
  }
  if (taken < n) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << '\n';
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << ' ' << ans[i].second << '\n';
  }
  return 0;
}
