#include <bits/stdc++.h>
using namespace std;
long long n, k, d, id;
vector<pair<long long, long long> > v;
void dfs(long long point, long long dep, long long 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 (long long i = 1; i <= d; i++) v.push_back(make_pair(i, i + 1));
  for (long long 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 (long long i = 0; i <= n - 2; i++)
    cout << v[i].first << " " << v[i].second << "\n";
  return 0;
}
