#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
const int mod = 1e9 + 7;
long long read() {
  long long c = getchar(), Nig = 1, x = 0;
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') Nig = -1, c = getchar();
  while (isdigit(c)) x = ((x << 1) + (x << 3)) + (c ^ '0'), c = getchar();
  return Nig * x;
}
int tot, n, d, k;
vector<pair<int, int> > ans;
void build(int now, int dep, int mdep) {
  if (dep == mdep) return;
  for (int i = 0; i < k - 1 - (!dep) && tot < n; i++) {
    ans.push_back({now, ++tot});
    build(tot, dep + 1, mdep);
  }
}
int main() {
  n = read(), d = read(), k = read();
  if (n <= d || d > 2 && k == 1) {
    printf("NO\n");
  } else {
    for (int i = 1; i <= d; i++) {
      ans.push_back({i, i + 1});
    }
    tot = d + 1;
    for (int i = 2; i <= d; i++) build(i, 0, min(i - 1, d - i + 1));
    if (tot < n) {
      printf("NO\n");
    } else {
      printf("YES\n");
      for (int i = 0; i < ans.size(); i++) {
        printf("%d %d\n", ans[i].first, ans[i].second);
      }
    }
  }
  return 0;
}
