#include <bits/stdc++.h>
using namespace std;
const int MAX = 400005;
vector<int> adj[MAX];
vector<pair<int, int> > edges;
set<int> fr;
int dist[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, d, k;
  cin >> n >> d >> k;
  if (d + 1 > n) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    edges.push_back(make_pair(i, i + 1));
    adj[i].push_back(i + 1);
    adj[i + 1].push_back(i);
    if (adj[i].size() > k) {
      cout << "NO\n";
      return 0;
    }
    if (i != 1) {
      fr.insert(i);
    }
  }
  if (d % 2 == 0) {
    for (int i = 1; i <= d / 2 + 1; i++) {
      dist[i] = i - 1;
    }
    for (int i = d / 2 + 2; i <= d + 1; i++) {
      dist[i] = d - i + 1;
    }
  } else {
    for (int i = 1; i <= (d + 1) / 2; i++) {
      dist[i] = i - 1;
    }
    for (int i = (d + 1) / 2 + 1; i <= d + 1; i++) {
      dist[i] = d - i + 1;
    }
  }
  int nxt = d + 2;
  while (nxt <= n) {
    if (fr.empty()) {
      cout << "NO\n";
      return 0;
    }
    int x = *(fr.begin());
    fr.erase(x);
    if (adj[x].size() < k) {
      edges.push_back(make_pair(x, nxt));
      adj[x].push_back(nxt);
      adj[nxt].push_back(x);
      dist[nxt] = dist[x] - 1;
      if (dist[nxt] > 0) {
        fr.insert(nxt);
      }
      if (adj[x].size() < k) fr.insert(x);
      nxt++;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < edges.size(); i++) {
    cout << edges[i].first << " " << edges[i].second << "\n";
  }
  return 0;
}
