#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const bool debugger1 = 1;
const bool debugger2 = 0;
const bool debugger3 = 0;
const bool debugger4 = 0;
const bool debugger5 = 0;
long long n, m, k, a, b, x, q, d;
vector<pair<int, int> > answer;
queue<pair<int, int> > kolejka;
int stopien[4 * 100005];
int main() {
  cin >> n >> d >> k;
  if (n > 2 && k == 1 || (d >= n)) {
    cout << "NO";
    return 0;
  }
  for (long long i = 1; i < d + 1; i++)
    answer.push_back(make_pair(i, i + 1)), stopien[i]++, stopien[i + 1]++;
  long long glebokosc = 1;
  for (int i = 2; i <= (d + 1) / 2; i++)
    kolejka.push(make_pair(i, glebokosc++));
  glebokosc = 1;
  for (int i = d; i > (d + 1) / 2; i--) kolejka.push(make_pair(i, glebokosc++));
  long long zostalo = n - (d + 1);
  int do_uzycia = d + 2;
  bool wyjeb = 1;
  if (d + 1 == n) wyjeb = 0;
  while (!kolejka.empty() && wyjeb) {
    pair<int, int> top = kolejka.front();
    kolejka.pop();
    int vb = top.first;
    int max_gleb = top.second;
    while ((stopien[vb] < k && max_gleb > 0) && wyjeb) {
      stopien[vb]++;
      kolejka.push(make_pair(do_uzycia, max_gleb - 1));
      answer.push_back(make_pair(vb, do_uzycia));
      stopien[do_uzycia]++;
      do_uzycia++;
      if (do_uzycia > n) {
        wyjeb = 0;
        break;
      }
    }
  }
  if (wyjeb) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (long long i = 0; i < answer.size(); i++)
    cout << answer[i].first << " " << answer[i].second << endl;
  return 0;
}
