#include <bits/stdc++.h>
using namespace std;
int edge[400001], NOE[400001];
int main() {
  int n, d, k;
  scanf("%d%d%d", &n, &d, &k);
  if (d >= n) {
    printf("NO\n");
    return 0;
  }
  if (d > 1 && k <= 1) {
    printf("NO\n");
    return 0;
  }
  vector<pair<int, int> > ans;
  for (int i = 1; i <= d; i++) {
    ans.push_back(make_pair(i, i + 1));
    edge[i]++;
    edge[i + 1]++;
  }
  int d1 = d, x = 2;
  int t = (d1 + 1) / 2 + 1;
  d += 2;
  for (int i = 2; i <= d1; i++) {
    NOE[i] = x;
    if ((d1 + 1) % 2 == 0 && i == t - 1) {
      continue;
    }
    if (i < t) {
      x += 2;
    } else {
      x -= 2;
    }
  }
  for (int i = 2; i <= n; i++) {
    if (d > n) {
      break;
    }
    int p = NOE[i];
    if (p <= 0) {
      continue;
    }
    while (edge[i] != k && d <= n) {
      ans.push_back(make_pair(i, d));
      edge[i]++;
      edge[d]++;
      NOE[d] = NOE[i] - 2;
      d++;
    }
    NOE[i] -= 2;
    if ((d1 + 1) % 2 == 0 && i == (d1 + 1) / 2) {
      continue;
    }
    if (i < t) {
      x += 2;
    } else {
      x -= 2;
    }
  }
  if (ans.size() == n - 1) {
    printf("YES\n");
    for (int i = 0; i < ans.size(); i++) {
      printf("%d %d\n", ans[i].first, ans[i].second);
    }
  } else {
    printf("NO\n");
  }
}
