#include <bits/stdc++.h>
using namespace std;
int n, d, k, cnt = 1;
vector<pair<int, int> > adj;
void dfs(int u, int dis, int m) {
  if (dis == m) return;
  for (int i = 0; i < k - 1 - (dis == 0); i++) {
    if (cnt == n) break;
    cnt++;
    adj.push_back(make_pair(cnt, u));
    dfs(cnt, dis + 1, m);
  }
}
int main() {
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  if (k == 1) {
    if (n == 1 && d == 0)
      cout << "YES" << endl;
    else if (n == 2 && d == 1)
      cout << "YES" << endl << "1 2";
    else
      cout << "NO";
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    adj.push_back(make_pair(i, i + 1));
    cnt++;
  }
  for (int i = 1; i <= d + 1; i++) dfs(i, 0, min(i - 1, d - i + 1));
  if (cnt < n) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < adj.size(); i++) {
    cout << adj[i].first << " " << adj[i].second << endl;
  }
}
