#include <bits/stdc++.h>
using namespace std;
const int N = 4e5;
struct item {
  int v, h, deg;
};
int n, d, k;
vector<pair<int, int>> G;
queue<item> Q;
void no() {
  cout << "NO";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> d >> k;
  if (d > n - 1 || (n > 2 && k == 1)) no();
  for (int i = 0; i < d; ++i) {
    G.push_back({i, i + 1});
    if (i > 0) Q.push({i, min(i, d - i), 2});
  }
  int next = d + 1;
  while (!Q.empty() && G.size() < n - 1) {
    int v = Q.front().v, h = Q.front().h, deg = Q.front().deg;
    Q.pop();
    while (G.size() < n - 1 && k - deg > 0) {
      G.push_back({v, next});
      if (h > 1) Q.push({next, h - 1, 1});
      ++deg;
      ++next;
    }
  }
  if (G.size() != n - 1) no();
  cout << "YES\n";
  for (auto e : G) cout << e.first + 1 << " " << e.second + 1 << "\n";
  return 0;
}
