#include <bits/stdc++.h>
using namespace std;
int n, d, k;
vector<pair<int, int> > v;
int deg[404707];
int q[404707 * 2];
void ae(int a, int b) {
  deg[a]++;
  deg[b]++;
  v.push_back(make_pair(a, b));
}
int main() {
  scanf("%d%d%d", &n, &d, &k);
  if (n <= 2) {
    puts("YES");
    if (n == 2) puts("1 2");
    return 0;
  }
  if (k == 1) {
    puts("NO");
    return 0;
  }
  if (k == 2) {
    if (n > d + 1 || n <= d)
      puts("NO");
    else {
      puts("YES");
      for (int i = 2; i <= n; i++) printf("%d %d\n", i - 1, i);
    }
    return 0;
  }
  if (d == 1 || d >= n) {
    puts("NO");
    return 0;
  }
  v.clear();
  int l = 0, r = 0, id = d + 1;
  for (int i = 1; i <= d; i++) {
    ae(i, i + 1);
    if (i > 1) {
      q[r++] = i;
      q[r++] = min(i - 1, d + 1 - i);
    }
  }
  while (l < r && id < n) {
    int cur = q[l++], rem = q[l++];
    for (; deg[cur] < k;) {
      id++;
      ae(cur, id);
      if (rem > 1) {
        q[r++] = id;
        q[r++] = rem - 1;
      }
    }
  }
  if (id < n)
    puts("NO");
  else {
    puts("YES");
    for (int i = 0; i < (int)v.size(); i++)
      printf("%d %d\n", v[i].first, v[i].second);
  }
  return 0;
}
