#include <bits/stdc++.h>
using namespace std;
int n, d, k, edge, i;
int main() {
  cin >> n >> d >> k;
  edge = n - 1;
  vector<pair<int, int>> v;
  queue<pair<int, pair<int, int>>> q;
  for (i = 1; i <= d; ++i) {
    v.push_back(make_pair(i, i + 1));
    if (i == 1) continue;
    pair<int, pair<int, int>> newNode;
    newNode.first = i;
    newNode.second.first = 2;
    if (i <= d / 2) {
      newNode.second.second = i - 1;
    } else if (i == d / 2 + 1 && d % 2 == 0) {
      newNode.second.second = i - 1;
    } else {
      newNode.second.second = d + 1 - i;
    }
    q.push(newNode);
  }
  edge -= d;
  while (edge && !q.empty()) {
    pair<int, pair<int, int>> temp;
    temp = q.front();
    int temp_a = temp.first;
    int temp_deg = temp.second.first;
    int temp_depth = temp.second.second;
    if (temp_depth > 0) {
      while (temp_deg < k && edge) {
        v.push_back(make_pair(temp_a, i + 1));
        pair<int, pair<int, int>> newNode;
        newNode.first = (++i);
        newNode.second.first = 1;
        newNode.second.second = temp_depth - 1;
        q.push(newNode);
        temp_deg++;
        edge--;
      }
      q.pop();
    } else
      q.pop();
  }
  if (edge) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < n - 1; ++i) {
      cout << v[i].first << " " << v[i].second << endl;
    }
  }
  return 0;
}
