#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, d, k;
  cin >> n >> d >> k;
  if (n <= d || k == 1) {
    if (n == 2 && d == 1) {
      cout << "YES\n1 2\n";
    } else {
      cout << "NO";
    }
  } else {
    int current = 0;
    int N = n;
    vector<vector<int>> tree(n);
    queue<pair<int, int>> queue;
    for (int i = 0; i < d; i++) {
      tree[i].push_back(i + 1);
    }
    for (int i = 1; i < d; i++) {
      queue.push(make_pair(i, min(i, d - i)));
    }
    current = d;
    n -= d + 1;
    while (n > 0 && !queue.empty()) {
      pair<int, int> pair = queue.front();
      queue.pop();
      if (pair.second > 0) {
        for (int i = (pair.first < d ? 2 : 1); i < k && n > 0; i++) {
          queue.push(make_pair(++current, pair.second - 1));
          tree[pair.first].push_back(current);
          --n;
        }
      }
    }
    if (n > 0) {
      cout << "NO";
    } else {
      cout << "YES\n";
      for (int i = 0; i < N; i++) {
        for (int j : tree[i]) {
          cout << i + 1 << ' ' << j + 1 << '\n';
        }
      }
    }
  }
  return 0;
}
