#include <bits/stdc++.h>
using namespace std;
template <typename T>
void prn(T first) {
  cout << first << "\n";
}
template <typename T, typename... Args>
void prn(T first, Args... args) {
  cout << first << " ";
  prn(args...);
}
long long counts[(int)1e6];
long long degr[(int)1e6];
int main() {
  long long i, j, t, n, d, k;
  scanf("%lld", &n);
  scanf("%lld", &d);
  scanf("%lld", &k);
  if (d > n - 1) {
    printf("NO\n");
    return 0;
  }
  set<long long> unused, used;
  for (int i = 1; i < 1e6; i++) {
    degr[i] = k;
    if (i <= n) {
      unused.insert(i);
    }
  }
  vector<long long> adj[n + 1];
  vector<long long> deg(n + 1, 0);
  vector<long long> depth(n + 1, 0);
  for (i = 1; i < d + 1; i++) {
    unused.erase(i);
    adj[i].push_back(i + 1);
    deg[i]++;
    deg[i + 1]++;
    if (i > 1) used.insert(i);
    if (i > 1)
      degr[i] -= 2;
    else
      degr[i]--;
  }
  unused.erase(d + 1);
  degr[d + 1]--;
  long long s = 1, e = d + 1, c = 0;
  while (s <= e) {
    counts[s] = c;
    counts[e] = c;
    c++;
    s++;
    e--;
  }
  while (!unused.empty()) {
    if (used.empty()) {
      cout << "NO" << endl;
      return 0;
    }
    long long a = *unused.begin();
    long long b = *used.begin();
    unused.erase(a);
    used.erase(b);
    adj[b].push_back(a);
    counts[a] = counts[b] - 1;
    degr[a]--;
    degr[b]--;
    if (counts[a] > 0 && degr[a] > 0) {
      used.insert(a);
    }
    if (degr[b] > 0) used.insert(b);
  }
  printf("YES\n");
  for (i = 1; i < n + 1; i++) {
    for (auto v : adj[i]) {
      printf("%lld %lld\n", i, v);
    }
  }
  return 0;
}
