#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO" << endl;
    return 0;
  }
  vector<int> deg(n);
  vector<pair<int, int>> ans;
  set<pair<int, int>> q;
  for (int i = 0; i < d; ++i) {
    ++deg[i];
    ++deg[i + 1];
    if (deg[i] > k || deg[i + 1] > k) {
      cout << "NO" << endl;
      return 0;
    }
    ans.push_back(make_pair(i, i + 1));
  }
  for (int i = 1; i < d; ++i) q.insert(make_pair(max(i, d - i), i));
  for (int i = d + 1; i < n; ++i) {
    while (!q.empty() && deg[q.begin()->second] == k) q.erase(q.begin());
    if (q.empty() || q.begin()->first == d) {
      cout << "NO" << endl;
      return 0;
    }
    ++deg[i];
    ++deg[q.begin()->second];
    ans.push_back(make_pair(i, q.begin()->second));
    q.insert(make_pair(q.begin()->first + 1, i));
  }
  assert(int(ans.size()) == n - 1);
  cout << "YES" << endl;
  vector<int> p(n);
  for (int i = 0; i < n; i++) p[i] = i;
  random_shuffle(p.begin(), p.end());
  for (int i = 0; i < n - 1; ++i)
    if (rand() % 2)
      cout << p[ans[i].first] + 1 << " " << p[ans[i].second] + 1 << endl;
    else
      cout << p[ans[i].second] + 1 << " " << p[ans[i].first] + 1 << endl;
  return 0;
}
