#include <bits/stdc++.h>
using namespace std;
const int maxN = 4e5 + 9, MOD = 998244353, maxV = 202;
int n, d, k, longi[maxN], cardi[maxN];
void revisaCagones() {
  if (n == 1 || (k == 1 && n > 2)) {
    cout << "NO\n";
    exit(0);
  }
}
vector<pair<int, int> > ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  revisaCagones();
  for (int i = 1; i <= d; i++) {
    ans.push_back(pair<int, int>(i - 1, i));
  }
  queue<int> q;
  for (int i = 1; i < d; i++) {
    longi[i] = max(i, d - i);
    cardi[i] = 2;
    q.push(i);
  }
  int nextNode = d + 1;
  while (ans.size() + 1 < n && q.size()) {
    int cr = q.front();
    q.pop();
    if (longi[cr] == d) continue;
    while (cardi[cr] < k && ans.size() + 1 < n) {
      cardi[nextNode] = 1;
      longi[nextNode] = longi[cr] + 1;
      ans.push_back(pair<int, int>(cr, nextNode));
      q.push(nextNode);
      cardi[cr]++;
      nextNode++;
    }
  }
  if (ans.size() + 1 != n) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (pair<int, int> el : ans)
    cout << el.first + 1 << ' ' << el.second + 1 << '\n';
}
