#include <bits/stdc++.h>
using namespace std;
int n, ind, k;
set<pair<int, int>> st;
void build_tree(int p, int d, int pos) {
  if (d == 0) return;
  for (int i = 0; i < pos; i++) {
    if (ind > n) return;
    st.insert({p, ind});
    ind++;
    build_tree(ind - 1, d - 1, k - 1);
  }
}
bool check(int d, int mx) {
  if (d & 1) {
    if ((d - 1) / 2 == mx) return false;
    return true;
  } else {
    if ((d - 2) / 2 == mx) return false;
    return true;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int d, i, j;
  cin >> n >> d >> k;
  if (n <= d) return cout << "NO" << endl, 0;
  if (k == 1) {
    if (n == 2)
      cout << "YES" << endl << 1 << ' ' << 2 << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  for (i = 1; i <= d; i++) st.insert({i, i + 1});
  ind = d + 2;
  for (i = 0; i < d; i++) build_tree(i + 1, min(i, d - i), k - 2);
  if (n >= ind) return cout << "NO" << endl, 0;
  cout << "YES" << endl;
  for (auto it : st) cout << it.first << ' ' << it.second << endl;
}
