#include <bits/stdc++.h>
using namespace std;
int TN = 1;
void solve() {
  int n, d, k;
  cin >> n >> d >> k;
  int cur = d + 1;
  vector<pair<int, int> > ve;
  int deg[400009];
  deg[1] = 1;
  for (int i = 0; i < d - 1; i++) {
    ve.push_back({i + 1, i + 2});
    deg[i + 2] = i + 2;
  }
  bool f = 0;
  for (int i = 1; i < d; i++) {
    int cur1;
    if (i == d)
      cur1 = k;
    else if (i == 1)
      cur1 = k - 1;
    else
      cur1 = k - 2;
    for (int j = 0; j < cur1; j++) {
      if (cur > n) {
        f = 1;
        break;
      }
      deg[cur] = deg[i] + 1;
      ve.push_back({i, cur});
      cur++;
    }
    if (f) break;
  }
  for (int i = d + 1; i <= n; i++) {
    for (int j = 0; j < k - 1; j++) {
      if (cur > n) {
        f = 1;
        break;
      }
      if (deg[i] >= d || !deg[i]) {
        continue;
      }
      ve.push_back({i, cur});
      deg[cur] = deg[i] + 1;
      cur++;
    }
    if (f) break;
  }
  if (cur == n + 1) {
    cout << "YES\n";
    for (int i = 0; i < (int)ve.size(); i++) {
      cout << ve[i].first << " " << ve[i].second << endl;
    }
  } else
    cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  while (TN--) solve();
  return 0;
}
