#include <bits/stdc++.h>
using namespace std;
long long graph[400006];
vector<pair<long long, long long> > ans;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               greater<pair<long long, long long> > >
    pq;
int main() {
  long long n, d, k, pl;
  cin >> n >> d >> k;
  if (d > n - 1) {
    cout << "NO" << endl;
    return 0;
  }
  memset(graph, 0, sizeof(graph));
  for (long long i = 1; i <= d; i++) {
    graph[i]++;
    graph[i + 1]++;
    if (graph[i] > k || graph[i + 1] > k) {
      cout << "NO";
      return 0;
    }
    ans.push_back({i, i + 1});
  }
  for (long long i = 2; i <= d; i++) {
    pq.push({max(i - 1, d - i + 1), i});
  }
  pl = d + 2;
  while (!pq.empty()) {
    if (pl == n + 1) break;
    pair<long long, long long> p = pq.top();
    pq.pop();
    if (p.first < d && graph[p.second] < k) {
      ans.push_back({p.second, pl});
      graph[p.second]++;
      graph[pl]++;
      if (graph[p.second] < k) pq.push({p.first, p.second});
      pq.push({p.first + 1, pl});
      pl++;
    }
    if (pq.empty() && pl <= n) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (pl < n + 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (long long i = 0; i < n - 1; i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
}
