#include <bits/stdc++.h>
using namespace std;
int n, d, k, nrest;
vector<int> adj[400009], rest;
vector<pair<int, int> > sol;
void rec(int y, int lo) {
  if (nrest == 0) return;
  nrest--;
  sol.push_back(make_pair(y, rest.back()));
  y = rest.back();
  rest.pop_back();
  if (lo > 0) {
    int kk = k - 1;
    while (kk--) {
      rec(y, lo - 1);
    }
  }
}
int main() {
  if ("Mohamed" == "Sobhy") {
  en:
    cout << "NO\n";
    return 0;
  }
  cin >> n >> d >> k;
  if (n <= d) {
    goto en;
  }
  for (int i = 1; i <= d; i++) {
    sol.push_back(make_pair(i, i + 1));
    adj[i].push_back(i + 1);
    adj[i + 1].push_back(i);
  }
  for (int i = d + 2; i <= n; i++) rest.push_back(i);
  nrest = n - (d + 1);
  for (int i = 2; i <= d; i++) {
    int resp = min(i - 1, d - i + 1);
    rec(i, resp - 1);
  }
  if (nrest > 0) goto en;
  cout << "YES\n";
  for (auto u : sol) {
    cout << u.first << " " << u.second << "\n";
  }
  return 0;
}
