#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k, d;
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  vector<int> deg(n, 0);
  vector<pair<int, int>> ans;
  set<pair<int, int>> s;
  for (int i = 0; i < d; i++) {
    ans.push_back({i, i + 1});
    deg[i]++;
    deg[i + 1]++;
    s.insert({max(i, d - i), i});
  }
  for (int i = 0; i < d; i++) {
    if (deg[i] > k) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = d + 1; i < n; i++) {
    if (s.size() == 0) {
      cout << "NO";
      return 0;
    }
    pair<int, int> cur = *s.begin();
    s.erase(s.begin());
    int a = cur.first, b = cur.second;
    if (a == d) {
      cout << "NO";
      return 0;
    }
    deg[b]++;
    deg[i]++;
    ans.push_back({i, b});
    if (deg[b] <= k) s.insert({a, b});
  }
  cout << "YES\n";
  for (auto i : ans) cout << i.first + 1 << ' ' << i.second + 1 << endl;
  return 0;
}
