#include <bits/stdc++.h>
using namespace std;
const long long int N = 600005;
vector<long long int> gr[N];
long long int deg[N];
long long int nxt;
long long int d, k, n;
void dfs(long long int cur, long long int dep) {
  if (dep <= 0) return;
  for (long long int i = 0; i < k; i++) {
    if (deg[cur] < k && nxt <= n) {
      gr[cur].push_back(nxt);
      gr[nxt++].push_back(cur);
      long long int last = nxt - 1;
      deg[cur]++;
      deg[last]++;
      dfs(last, dep - 1);
    } else {
      break;
    }
  }
}
void solve() {
  long long int i, j, m, ans = 0, cnt = 0, sum = 0;
  cin >> n >> d >> k;
  for (i = 1; i <= d; i++) {
    gr[i].push_back(i + 1);
    gr[i + 1].push_back(i);
    deg[i]++;
    deg[i + 1]++;
  }
  nxt = d + 2;
  for (i = 2; i <= d; i++) {
    dfs(i, min(i - 1, (d + 1 - i)));
  }
  if (nxt <= n || nxt > n + 1) {
    cout << "NO";
    return;
  }
  for (i = 1; i <= n; i++) {
    if (deg[i] > k) {
      cout << "NO";
      return;
    }
  }
  cout << "YES\n";
  for (i = 1; i <= n; i++) {
    for (auto x : gr[i]) {
      if (x < i) {
        cout << x << " " << i << '\n';
      }
    }
  }
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
