#include <bits/stdc++.h>
using namespace std;
int n, k, d, id;
vector<pair<int, int> > v;
void dfs(int point, int dep, int maxdep) {
  if (dep == maxdep) return;
  for (int i = 0; i < k - 1 - (dep == 0) && id < n; i++) {
    v.push_back(make_pair(point, ++id));
    dfs(id, dep + 1, maxdep);
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  if (n <= d || d > 1 && k < 2) {
    cout << "NO\n";
    return 0;
  }
  id = d + 1;
  for (int i = 1; i <= d; i++) v.push_back(make_pair(i, i + 1));
  for (int i = 2; i <= d; i++) dfs(i, 0, min(i - 1, d - i + 1));
  if (id < n) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i <= n - 2; i++)
    cout << v[i].first << " " << v[i].second << "\n";
  return 0;
}
