#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long>> ans;
long long n, d, k;
long long gl = 0;
void fun(long long from, long long to, long long cnt, long long pos, bool is) {
  if (cnt >= pos || ans.size() >= n - 1 || to > n || from > n) {
    return;
  }
  for (long long i = 0; i < k - 1 - is; ++i) {
    if (to + i > n) {
      return;
    }
    ans.push_back({from, to + i});
    gl = max(gl, to + i);
    fun(to, gl + 1, cnt + 1, pos, false);
  }
}
signed main() {
  cin >> n >> d >> k;
  vector<long long> h(n + 1);
  if (d > n - 1) {
    cout << "NO";
    return 0;
  }
  for (long long i = 1; i <= d; ++i) {
    ans.push_back({i, i + 1});
    h[i]++;
    h[i + 1]++;
    if (h[i] > k || h[i + 1] > k) {
      cout << "NO";
      return 0;
    }
  }
  gl = d + 2;
  long long lst = 2;
  long long ps = 0;
  long long l = 0;
  while (ans.size() < n - 1 && l <= n) {
    if (l >= d / 2) {
      --ps;
    } else {
      ++ps;
    }
    fun(lst, gl, 0, ps, true);
    ++l;
    ++lst;
    ++gl;
  }
  if (ans.size() < n - 1) {
    cout << "NO";
    return 0;
  }
  while (ans.size() > n - 1) {
    ans.pop_back();
  }
  cout << "YES" << '\n';
  for (auto i : ans) {
    cout << i.first << " " << i.second << '\n';
  }
}
