#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
vector<pair<long long, long long>> edge;
void solve() {
  long long n, d, k;
  cin >> n >> d >> k;
  if (d > n - 1 or k > n - 1) {
    cout << "NO";
    return;
  }
  vector<long long> diameter(d + 1);
  iota(diameter.begin(), diameter.end(), 1);
  for (long long i = 1; i < diameter.size(); i++)
    edge.emplace_back(diameter[i], diameter[i - 1]);
  vector<long long> depth(d + 1);
  for (long long i = 0; i < diameter.size(); i++)
    depth[i] = min(diameter[i] - 1, d - (diameter[i] - 1));
  long long id1 = 1, node = d + 2;
  while (node <= n and id1 < diameter.size()) {
    long long rel = depth[id1];
    vector<pair<long long, long long>> nd;
    for (long long i = 0; i < k - 2; i++) {
      edge.push_back({diameter[id1], node++});
      if (rel - 1 > 0) nd.push_back({node - 1, rel - 1});
      if (node > n) break;
    }
    long long cur = 0;
    while (cur < nd.size() and node < n) {
      for (long long i = 0; i < k - 1; i++) {
        edge.push_back({nd[cur].first, node++});
        if (nd[cur].second - 1 > 0)
          nd.push_back({node - 1, nd[cur].second - 1});
        if (node > n) break;
      }
      cur++;
    }
    id1++;
  }
  if (node <= n) {
    cout << "NO" << '\n';
    return;
  }
  cout << "YES" << '\n';
  for (auto x : edge) cout << x.first << " " << x.second << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t = 1;
  while (t--) solve();
  return 0;
}
