#include <bits/stdc++.h>
using namespace std;
pair<int, int> t[4] = {make_pair(0, 1), make_pair(1, 0), make_pair(-1, 0),
                       make_pair(0, -1)};
class compare {
 public:
  bool operator()(pair<int, int> a, pair<int, int> b) {
    return (a.second > b.second);
  }
};
bool compare2(long long int a, long long int b) { return (a < b); }
vector<pair<int, int> > v;
int l = 3;
int n, d, k;
void maketree(int j, int height) {
  if (l > n) {
    return;
  }
  if (height == 0) {
    return;
  }
  for (int i = 0; i < k - 1 && l <= n; i++) {
    v.push_back(make_pair(j, l++));
    maketree(l - 1, height - 1);
  }
  return;
}
int main() {
  cin >> n >> d >> k;
  if (n <= d) {
    cout << "NO" << endl;
    ;
    return 0;
  }
  v.push_back(make_pair(1, 2));
  maketree(2, d - 1);
  if (l != n + 1) {
    cout << "NO" << endl;
    ;
  } else {
    cout << "YES" << endl;
    ;
    for (int i = 0; i < v.size(); i++) {
      cout << v[i].first << " " << v[i].second << endl;
      ;
    }
  }
}
