#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MN = 4e5 + 5;
int N, D, K;
struct Thing {
  int deg, dis, node;
  bool operator<(const Thing &o) const { return deg < o.deg; }
};
void edgeCase() {
  if (D + 1 > N) {
    cout << "NO\n";
    exit(0);
  }
  if (N == 2) {
    cout << "YES\n1 2\n";
    exit(0);
  }
  if (K == 1) {
    cout << "NO\n";
    exit(0);
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> N >> D >> K;
  edgeCase();
  vector<pii> edges;
  priority_queue<Thing> q;
  for (int i = 2; i <= D + 1; i++) {
    edges.emplace_back(i - 1, i);
    if (i != D + 1) q.push({K - 2, max(i - 1, D + 1 - i), i});
  }
  N -= D + 1;
  int cur = D + 2;
  while (N > 0) {
    if (q.empty()) break;
    auto [deg, dis, node] = q.top();
    q.pop();
    int can = min(deg, N);
    for (int i = 0; i < can; i++) {
      edges.emplace_back(node, cur);
      if (dis + 1 < D) q.push({K - 1, dis + 1, cur});
      cur++;
      N--;
    }
  }
  if (N)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (auto [u, v] : edges) cout << u << " " << v << '\n';
  }
  return 0;
}
