#include <bits/stdc++.h>
using namespace std;
long long n, d, k, nxt;
vector<pair<long long, long long> > ans;
void add_edges(long long dep, long long prev, long long can) {
  if (dep == 0 || nxt > n) return;
  for (long long i = 0; i < can; i++) {
    if (nxt <= n) {
      ans.push_back({prev, nxt++});
      add_edges(dep - 1, nxt - 1, k - 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  d++;
  if (k == 1) {
    if (n <= 2) {
      if (n == 1 && d == 1)
        cout << "YES";
      else if (n == 2 && d == 2)
        cout << "YES\n1 2";
      else
        cout << "NO";
    } else
      cout << "NO";
    return 0;
  }
  if (n < d) return cout << "NO", 0;
  for (long long i = 2; i <= d; i++) ans.push_back({i - 1, i});
  nxt = d + 1;
  for (long long i = 2; i < d; i++) add_edges(min(i - 1, d - i), i, k - 2);
  if (nxt <= n) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (auto i : ans) cout << i.first << " " << i.second << "\n";
  return 0;
}
