#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int n, d, k;
int id;
vector<pair<int, int> > ans;
void DFS(int u, int dep, int maxd) {
  if (dep == maxd) return;
  for (int i = 0; i < k - 1 - (dep == 0) && id < n; i++) {
    ans.push_back(make_pair(u, ++id));
    DFS(id, dep + 1, maxd);
  }
}
int main() {
  cin >> n >> d >> k;
  if (n <= d || d > 1 && k < 2) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= d; i++) ans.push_back(make_pair(i, i + 1));
  id = d + 1;
  for (int i = 2; i <= d; i++) DFS(i, 0, min(i - 1, d - i + 1));
  if (id < n)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < ans.size(); i++)
      printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
