#include <bits/stdc++.h>
using namespace std;
#pragma GCC push_options
#pragma GCC optimize("unroll-loops")
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, d, k;
  cin >> n >> d >> k;
  if (n < d + 1) {
    cout << "NO\n";
    exit(0);
  }
  if (k == 1) {
    if (n == 2) {
      cout << "YES\n";
      cout << 1 << " " << 2 << "\n";
    } else
      cout << "NO\n";
    exit(0);
  }
  vector<pair<long long, long long>> ans;
  priority_queue<pair<long long, pair<long long, long long>>> pq;
  for (long long i = 1; i <= d; i++) {
    ans.emplace_back(make_pair(i, i + 1));
    long long temp = min({i - 1, d + 1 - i, k - 2});
    if (temp > 0) {
      pq.push(make_pair(temp, make_pair(min(i - 1, d + 1 - i), i)));
    }
  }
  long long degree[n + 1];
  for (int i = 0; i <= n; i++) degree[i] = 0ll;
  degree[0] = degree[d + 1] = 1ll;
  for (int i = 1; i <= d; i++) degree[i] = 2ll;
  long long i = d + 2;
  while (i <= n) {
    if (pq.size() == 0) {
      cout << "NO\n";
      exit(0);
    }
    auto p = pq.top();
    pq.pop();
    degree[p.second.second]++;
    long long temp = min(p.first, k - degree[p.second.second]);
    ans.emplace_back(make_pair(p.second.second, i));
    if (temp > 0) {
      pq.push(make_pair(temp, make_pair(p.second.first - 1, p.second.second)));
    }
    temp = min(k - 1, p.second.first - 1);
    if (temp > 0) {
      pq.push(make_pair(temp, make_pair(p.second.first - 1, i)));
      degree[i] = 1ll;
    }
    i++;
  }
  cout << "YES\n";
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << "\n";
  return 0;
}
