#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int nxi() {
  int a;
  cin >> a;
  return a;
}
vector<long long> a;
void inc(int i, long long v) {
  for (; i < a.size(); i |= i + 1) {
    a[i] = max(a[i], v);
  }
}
long long get(int r) {
  long long ans = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) {
    ans = max(ans, a[r]);
  }
  return ans;
}
long long get(int l, int r) { return get(r) - get(l - 1); }
template <class _T>
_T gcd(_T a, _T b) {
  return a == 0 ? b : gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(0);
  int n = nxi(), d = nxi(), k = nxi();
  vector<vector<int> > adj(n);
  set<pair<int, int> > q;
  int cur = d + 1;
  if (d >= n || k == 1 && n > 2) {
    cout << "NO";
  } else {
    adj[0].push_back(1);
    for (int i = 1; i < d; ++i) {
      adj[i].push_back(i + 1);
      q.insert(make_pair(max(i, d - i), i));
    }
    while (cur < n && !q.empty()) {
      auto p = *q.begin();
      q.erase(q.begin());
      int dist = p.first + 1;
      if (dist <= d) {
        int limit = p.second <= d ? k - 2 : k - 1;
        for (int i = 0; i < limit && cur < n; i++, cur++) {
          adj[p.second].push_back(cur);
          q.insert(make_pair(dist, cur));
        }
      }
    }
    if (cur == n) {
      cout << "YES\n";
      for (int i = 0; i < n; i++)
        for (int v : adj[i]) cout << (i + 1) << ' ' << (v + 1) << endl;
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
