#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, k;
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  int degree[n + 1];
  for (int i = 1; i <= n; i++) degree[i] = 0;
  map<int, int> m;
  priority_queue<pair<int, int>, vector<pair<int, int>>,
                 greater<pair<int, int>>>
      dist;
  pair<int, int> p;
  for (int i = 1; i <= d; i++) {
    if (i == 1) {
      dist.push(make_pair(i, d));
    } else if (i == d) {
      dist.push(make_pair(i, d - 1));
      dist.push(make_pair(i + 1, d));
    } else {
      dist.push(make_pair(i, max(i - 1, d - i + 1)));
    }
    m[i] = i + 1;
    degree[i]++;
    degree[i + 1]++;
  }
  for (int i = d + 2; i <= n; i++) {
    bool flag = false;
    p = dist.top();
    int x, y;
    x = p.first;
    y = p.second;
    if (degree[x] < k && y + 1 <= d && m[i] != x && m[x] != i && x != i) {
      flag = true;
      degree[i]++;
      degree[x]++;
      m[i] = x;
      dist.push(make_pair(i, y + 1));
      break;
    }
    if (!flag) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (degree[i + 1] > k) {
      cout << "NO";
      return 0;
    }
  }
  map<int, int>::iterator i;
  cout << "YES" << endl;
  for (i = m.begin(); i != m.end(); i++) {
    cout << i->first << " " << i->second << endl;
  }
  return 0;
}
