#include <bits/stdc++.h>
using namespace std;
const int MN = 4e5 + 5;
int N, D, K, cur, pt;
pair<int, int> ans[MN];
void dfs(int u, int deg, int dis) {
  if (pt >= N - 1 || deg <= 0 || dis <= 0) return;
  for (int i = 0; i < deg; i++) {
    if (pt >= N - 1) break;
    ans[pt++] = {u, ++cur};
    dfs(cur, K - 1, dis - 1);
  }
}
int main() {
  scanf("%d %d %d", &N, &D, &K);
  for (int i = 1; i <= D; i++) ans[pt++] = {i, i + 1};
  cur = D + 1;
  for (int i = 2; i <= D; i++) dfs(i, K - 2, D - max(i - 1, D - i + 1));
  int a, b;
  if (pt == N - 1) {
    printf("YES\n");
    for (int i = 0; i < N - 1; i++) {
      tie(a, b) = ans[i];
      printf("%d %d\n", a, b);
    }
  } else
    printf("NO\n");
}
