#include <bits/stdc++.h>
using namespace std;
const int MAX = 5e5 + 5;
int n, d, k, c, diam[MAX];
vector<pair<int, int> > v;
void dfs(int u, int deg, int l, int lev = 0) {
  if (lev == l) return;
  vector<int> nods;
  for (int i = 1; i <= deg && c <= n; i++, c++) nods.push_back(c);
  for (int o : nods) {
    v.push_back({u, o});
    dfs(o, k - 1, l, lev + 1);
  }
}
int main() {
  scanf("%d%d%d", &n, &d, &k);
  if (d >= n) {
    printf("NO\n");
    return 0;
  }
  if (k == 1 && n > 2) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= d + 1; i++) diam[i] = ++c;
  c++;
  for (int i = 1; i <= d; i++) v.push_back({diam[i], diam[i + 1]});
  for (int i = 2; i <= d; i++) {
    int l = min(i - 1, d + 1 - i);
    dfs(diam[i], k - 2, l);
  }
  if ((int)v.size() != n - 1) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  for (auto o : v) printf("%d %d\n", o.first, o.second);
  return 0;
}
