#include <bits/stdc++.h>
const int N = 400100;
int deg[N], can[N];
std::vector<int> g[N];
int main(void) {
  int n, d, k;
  scanf("%d%d%d", &n, &d, &k);
  if (n < d + 1) {
    printf("NO\n");
    return 0;
  }
  for (int i = 0; i < d; ++i) {
    g[i].push_back(i + 1);
    ++deg[i];
    ++deg[i + 1];
  }
  int cur = d + 1;
  std::queue<int> setik;
  for (int i = 0; i <= d; ++i) {
    can[i] = std::min(i, d - i);
    if (can[i] > 0 && deg[i] < k) {
      setik.push(i);
    }
  }
  while (cur < n && !setik.empty()) {
    int v = setik.front();
    setik.pop();
    while (cur < n && deg[v] < k) {
      g[v].push_back(cur);
      ++deg[v];
      ++deg[cur];
      can[cur] = can[v] - 1;
      if (can[cur] != 0) {
        setik.push(cur);
      }
      ++cur;
    }
  }
  if (cur < n) {
    printf("NO\n");
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    if (deg[i] > k) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    for (auto j : g[i]) {
      printf("%d %d\n", i + 1, j + 1);
    }
  }
  return 0;
}
