#include <bits/stdc++.h>
using namespace std;
int n, d, k, hd;
vector<pair<int, int> > adj;
void dfs(int nw, int dep, int mxdp) {
  if (dep == mxdp) return;
  for (int i = 0; i < k - 1 - (dep == 0) && hd < n; i++) {
    adj.push_back({nw, ++hd});
    dfs(hd, dep + 1, mxdp);
  }
}
int main() {
  cin >> n >> d >> k;
  hd = d + 1;
  if (n < d || hd < n || (d > 1 && k < 2)) return cout << "NO" << '\n', 0;
  for (int i = 1; i <= d; i++) adj.push_back({i, i + 1});
  for (int i = 2; i <= d; i++) dfs(i, 0, min(i - 1, d - i + 1));
  cout << "YES" << '\n';
  for (int i = 0; i <= n - 2; i++)
    cout << adj[i].first << ' ' << adj[i].second << '\n';
  return 0;
}
