#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 10;
int n, d, k, idx, e[N];
void dfs(int u, int r) {
  if (!r || idx == n) return;
  while (e[u] != k && idx != n) {
    int v = ++idx;
    cout << u << ' ' << v << endl;
    dfs(v, r - 1);
    e[u]++;
  }
}
int main(void) {
  std::ios::sync_with_stdio(false);
  cin >> n >> d >> k;
  int s = 1 + (d % 2) * k, x = 1, t = d / 2;
  while (t--) s += x *= k;
  if (s < n)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    idx = d + 1;
    for (int i = 1; i <= d; i++) {
      cout << i << ' ' << i + 1 << endl;
      e[i]++, e[i + 1]++;
    }
    for (int i = 2; i <= d; i++) dfs(i, min(i - 1, d + 1 - i));
  }
  return 0;
}
