#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 7;
int n, d, k, now;
vector<pair<int, int> > Q;
vector<int> E[maxn];
void dfs(int x, int y, int z) {
  if (z == y) return;
  for (int i = 0; i < k - 1 - (y == 0) && now < n; i++) {
    now++;
    int u = now;
    Q.push_back(make_pair(x, u));
    dfs(u, y + 1, z);
  }
}
int main(int argc, char const *argv[]) {
  cin >> n >> d >> k;
  if (n < (d + 1) || k == 1) {
    cout << "NO" << endl;
    return 0;
  }
  if (d == 1 || n == 2) {
    if (d == 1 && n == 2)
      cout << "YES\n1 2" << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  now = d + 1;
  for (int i = 1; i <= d; i++) {
    E[i].push_back(i + 1);
    Q.push_back(make_pair(i, i + 1));
  }
  for (int i = 1; i <= d + 1; i++) {
    dfs(i, 0, min(i - 1, d + 1 - i));
  }
  if (now < n) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i <= n - 2; i++)
    cout << Q[i].first << " " << Q[i].second << endl;
  return 0;
}
