#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5 + 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    int n, d, k, i;
    vector<pair<int, int>> tree;
    cin >> n >> d >> k;
    if (d + 1 > n) {
      cout << "NO";
      return 0;
    }
    int deg[n + 1];
    for (i = 0; i < n + 1; i++) deg[i] = 1;
    for (i = 1; i < d + 1; i++) {
      tree.push_back({i, i + 1});
      deg[i] = 2;
    }
    int rem = i + 1;
    vector<int> temp[mxn];
    int lvl[mxn] = {0};
    for (i = 2; i < d + 1; i++) {
      int mlvl = min(i - 1, d + 1 - i);
      if (k > 3) mlvl = (mlvl + 1) / 2;
      int himj = i;
      queue<int> q;
      q.push(i);
      while (!q.empty()) {
        himj = q.front();
        q.pop();
        if (lvl[himj] == mlvl) break;
        while (deg[himj] < k) {
          tree.push_back({himj, rem});
          lvl[rem] = lvl[himj] + 1;
          q.push(rem);
          rem++;
          deg[himj]++;
          if (rem > n) break;
        }
        if (rem > n) break;
      }
      if (rem > n) break;
    }
    if (rem <= n) {
      cout << "NO";
      return 0;
    }
    cout << "YES\n";
    for (i = 0; i < tree.size(); i++)
      cout << tree[i].first << " " << tree[i].second << "\n";
  }
  return 0;
}
