#include <bits/stdc++.h>
using namespace std;
queue<pair<pair<int, int>, int> > v;
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  int n, m, k, d, t = 0, a[500100] = {0};
  cin >> n >> d >> k;
  if (k == 1 && d == 1 && n == 2) {
    cout << "YES\n1 2\n";
    return 0;
  } else if (k == 1) {
    cout << "NO\n";
    return 0;
  }
  if (d >= n) {
    cout << "NO\n";
    return 0;
  }
  m = d / 2;
  v.push(make_pair(make_pair(t++, -1), m--));
  while (m >= 0) {
    a[t]++;
    a[t - 1]++;
    v.push(make_pair(make_pair(t, t - 1), m--));
    ans.push_back(make_pair(t, t - 1));
    t++;
  }
  m = (d + 1) / 2 - 1;
  v.push(make_pair(make_pair(t++, 0), m--));
  ans.push_back(make_pair(t - 1, 0));
  a[0]++;
  a[t - 1]++;
  while (m >= 0) {
    a[t - 1]++;
    a[t]++;
    v.push(make_pair(make_pair(t, t - 1), m--));
    ans.push_back(make_pair(t - 1, t));
    t++;
  }
  if (ans.size() > n - 1) {
    cout << "NO\n";
    return 0;
  }
  while (!v.empty()) {
    if (ans.size() == n - 1) break;
    pair<pair<int, int>, int> h = v.front();
    if (a[h.first.first] >= k || h.second == 0) {
      v.pop();
      continue;
    }
    a[h.first.first]++;
    a[t]++;
    v.push(make_pair(make_pair(t, h.first.first), h.second - 1));
    ans.push_back(make_pair(t, h.first.first));
    t++;
  }
  if (ans.size() != n - 1) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first + 1 << ' ' << ans[i].second + 1 << '\n';
  return 0;
}
