#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long N = 4e5 + 5;
long long n, d, k, cur, deg[N];
set<pair<long long, long long> > edg;
void dfs(long long at, long long deep, long long chld) {
  if (cur > n or deep == 0) return;
  for (long long i = 0; i < chld; i++) {
    if (cur > n) return;
    edg.insert({min(at, cur), max(at, cur)});
    cur++;
    if (cur > n) return;
    dfs(cur - 1, deep - 1, k - 1);
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  for (long long i = 1; i <= d; i++) {
    edg.insert({i, i + 1});
  }
  cur = d + 2;
  for (long long i = 1; i <= d + 1; i++) {
    if (cur > n) break;
    long long f = min(i - 1, d - i + 1);
    dfs(i, f, k - 2);
  }
  if ((long long)(edg.size()) != n - 1) {
    cout << "NO\n";
    return 0;
  }
  for (auto it : edg) {
    deg[it.first]++;
    deg[it.second]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (deg[i] <= k and deg[i] >= 1) {
      continue;
    }
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (auto it : edg) {
    cout << it.first << " " << it.second << endl;
  }
  return 0;
}
