#include <bits/stdc++.h>
using namespace std;
int n, d, k, current;
vector<pair<int, int> > res;
void gen(int x, int len, int kt) {
  if (len <= 0) return;
  for (int i = 1; i <= k - 1 - kt; i++) {
    if (current >= n) return;
    current++;
    res.push_back(make_pair(x, current));
    gen(current, len - 1, 0);
  }
}
int main() {
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  if (k == 1) {
    if (n == 1)
      cout << "YES";
    else
      cout << "NO";
    return 0;
  }
  for (int i = 1; i <= d; i++) res.push_back(make_pair(i, i + 1));
  current = d + 1;
  for (int i = 2; i <= d; i++) {
    int len = d - max(i - 1, d + 1 - i);
    gen(i, len, 1);
  }
  if (current != n)
    cout << "NO" << endl;
  else {
    cout << "YES\n";
    for (int i = 0; i < n - 1; i++)
      cout << res[i].first << " " << res[i].second << "\n";
  }
  return 0;
}
