#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return (power(x, y / 2) * power(x, y / 2)) % 998244353;
  else
    return ((x * power(x, y / 2)) % 998244353 * power(x, y / 2)) % 998244353;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, d, k, i, j, cnt = 0, x;
  cin >> n >> d >> k;
  bool flag = 0;
  queue<long long> q;
  vector<pair<long long, long long> > v;
  if (n <= d) flag = 1;
  if (n == 1 && k == 1 && d == 1) {
    cout << "YES";
    return 0;
  }
  for (i = 2; i <= k + 1; i++) v.push_back({1, i});
  q.push(2);
  q.push(-1);
  x = k + 2;
  long long level = 2;
  while (!q.empty()) {
    long long l = q.front();
    if (l == -1) {
      q.pop();
      level++;
      if (level > k) {
        flag = 1;
        break;
      }
      l = q.front();
    }
    q.pop();
    for (i = 0; i < k - 1; i++) {
      v.push_back({l, x + i});
      q.push(x + i);
    }
    x = x + i;
    if (x > n) break;
    q.push(-1);
  }
  if (flag == 1) {
    cout << "NO";
  } else {
    cout << "YES";
    for (i = 0; i < v.size(); i++) {
      cout << v[i].first << " " << v[i].second << endl;
    }
  }
  cerr << (1000 * clock()) / CLOCKS_PER_SEC << "ms";
  return 0;
}
