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