#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const double EPS = 1e-9;
int cmp(double first, double second = 0, double tol = EPS) {
  return (first <= second + tol) ? (first + tol < second) ? -1 : 0 : 1;
}
int n, d, k;
vector<pair<int, int> > ans;
int lst;
void no() {
  printf("NO\n");
  exit(0);
}
void func(int v, int d, int lvl) {
  if (!lvl || !d) return;
  if (lst == n + 1) return;
  for (int i = 0; lst <= n && i < d; ++i) {
    ans.push_back({v, lst});
    lst++;
    func(lst - 1, k - 1, lvl - 1);
  }
}
int main() {
  scanf("%d %d %d", &n, &d, &k);
  if (n == 1 || (d > 1 && k == 1) || d >= n || (d == 1 && n > 2) ||
      (d == 2 && k < n - 1))
    no();
  else if (d == 1) {
    printf("YES\n");
    printf("1 2\n");
  } else if (d == 2) {
    printf("YES\n");
    for (int i = 2; i <= n; ++i) printf("1 %d\n", i);
  } else {
    int st = 1;
    int en = 1 + d;
    lst = en + 1;
    for (int i = 1; i < en; ++i) ans.push_back({i, i + 1});
    for (int i = 1; i <= en; ++i) func(i, k - 2, min(i - st, en - i));
    if (ans.size() == n - 1) {
      printf("YES\n");
      for (pair<int, int> p : ans) printf("%d %d\n", p.first, p.second);
    } else
      no();
  }
  return 0;
}
