#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
int dep[400005];
int deg[400005];
void no() { cout << "NO", exit(0); }
int main() {
  ios::sync_with_stdio(0);
  int n, d, k;
  cin >> n >> d >> k;
  if (d >= n) no();
  if (d >= 2 && k < 2) no();
  vector<pii> sol;
  sol.reserve(n);
  for (int i = 2; i <= d + 1; ++i) {
    sol.emplace_back(i - 1, i);
    dep[i] = min(i - 1, d + 1 - i);
    deg[i] = 1 + (1 < i && i < d + 1);
  }
  int last = d + 1;
  stack<int> stk;
  for (int i = 2; i <= d; ++i) stk.push(i);
  while (!stk.empty()) {
    int x = stk.top();
    stk.pop();
    while (last < n && deg[x] < k) {
      sol.emplace_back(x, ++last);
      deg[x]++;
      if (dep[x] > 1) {
        dep[last] = dep[x] - 1;
        deg[last] = 1;
        stk.emplace(last);
      }
    }
  }
  if (last != n) no();
  cout << "YES\n";
  for (pii e : sol) cout << e.first << ' ' << e.second << '\n';
}
