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