#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, d, k;
  cin >> n >> d >> k;
  if (n == 1 || n - 1 < d || (k == 1 && n > 2)) {
    cout << "NO\n";
    return 0;
  }
  vector<pair<int, int>> edges;
  for (int i = 1; i <= d; i++) edges.emplace_back(i, i + 1);
  n -= d + 1;
  int id = d + 2;
  if (k > 2)
    for (int i = 1; i <= d + 1; i++) {
      if (n == 0) break;
      int canAdd = min(i - 1, d + 1 - i);
      if (canAdd == 0) continue;
      queue<pair<int, pair<int, int>>> q;
      q.push({i, {k - 2, 0}});
      while (n > 0 && !q.empty()) {
        int u = q.front().first, dd = q.front().second.second;
        if (dd == canAdd) break;
        if (--q.front().second.first == 0) q.pop();
        edges.emplace_back(u, id);
        q.push({id++, {k - 1, dd + 1}});
        n--;
      }
    }
  if (n > 0) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (auto e : edges) cout << e.first << " " << e.second << "\n";
  return 0;
}
