#include <bits/stdc++.h>
using namespace std;
int dcmp(long double n, long double y) {
  return fabs(n - y) <= 1e-9 ? 0 : n < y ? -1 : 1;
}
vector<vector<int> > adj;
set<pair<int, int> > q;
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, d, k;
  cin >> n >> d >> k;
  vector<int> deg(n);
  if (d >= n) {
    cout << "NO\n";
    return 0;
  }
  int cur = 1;
  for (int i = 0; i < (int)(d); ++i) {
    deg[i]++;
    deg[i + 1]++;
    if (deg[i] > k || deg[i + 1] > k) {
      cout << "NO\n";
      return 0;
    }
    ans.push_back({i, i + 1});
  }
  for (int i = 1; i < d; i++) {
    q.insert({max(i, d - i), i});
  }
  for (int i = d + 1; i < n; i++) {
    while (!q.empty() && deg[q.begin()->second] == k) {
      q.erase(q.begin());
    }
    if (q.empty() || q.begin()->first == d) {
      cout << "NO\n";
      return 0;
    }
    deg[i]++;
    deg[q.begin()->second]++;
    ans.push_back({i, q.begin()->second});
    q.insert({q.begin()->first + 1, i});
  }
  cout << "YES\n";
  for (int i = 0; i < ((int)((ans).size())); ++i) {
    cout << ans[i].first + 1 << ' ' << ans[i].second + 1 << '\n';
  }
}
