#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int n, d, k;
int edge[N], kc[N];
vector<pair<int, int> > v;
queue<int> q;
int main() {
  cin >> n >> d >> k;
  int dem = d + 1;
  if (dem > n || (d == 1 && n > 2) || (k == 1 && d > 1)) {
    cout << "NO";
    return 0;
  }
  for (int i = 2; i <= d; ++i) {
    edge[i] = 2;
    kc[i] = max(i - 1, d - i + 1);
    if (kc[i] < d && edge[i] < k) q.push(i);
    v.push_back({i - 1, i});
  }
  v.push_back({d, d + 1});
  while (!q.empty() && dem < n) {
    int u = q.front();
    q.pop();
    if (kc[u] < d && edge[u] < k) {
      for (int i = 1; i <= k - edge[u]; ++i) {
        dem++;
        kc[dem] = kc[u] + 1;
        edge[dem] = 1;
        if (kc[dem] < d && edge[dem] < k) q.push(dem);
        v.push_back(pair<int, int>(u, dem));
        if (dem == n) break;
      }
    }
  }
  if (dem < n) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (auto& x : v) cout << x.first << ' ' << x.second << "\n";
}
