#include <bits/stdc++.h>
using namespace std;
int n, d, k, number;
vector<pair<int, int> > p;
void dfs(int x, int depth, int disRemain);
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n >> d >> k;
  if ((n <= d) || (d > 1 && k < 2)) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    p.push_back(make_pair(i, i + 1));
  }
  number = d + 1;
  int j = d;
  int num = n - 1 - d;
  for (int i = 2; i <= d; i++) {
    int disRemain;
    if (i < number / 2)
      disRemain = i - 1;
    else {
      disRemain = number - i - 1;
    }
    dfs(i, 0, disRemain);
  }
  if (number < n)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < p.size(); i++) {
      cout << p[i].first << ' ' << p[i].second << endl;
    }
  }
}
void dfs(int x, int depth, int disRemain) {
  if (depth == disRemain)
    return;
  else {
    for (int i = 0; i < k - 1 - (depth == 0) && number < n; i++) {
      number++;
      p.push_back(make_pair(x, number));
      dfs(number, depth + 1, disRemain);
    }
  }
}
