#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int a, b;
};
Edge* newEdge(int a, int b) {
  Edge* temp = new Edge;
  temp->a = a;
  temp->b = b;
  return temp;
}
vector<Edge*> e;
int main() {
  int nVert, diam, degree;
  cin >> nVert >> diam >> degree;
  int deg[nVert + 1], dist[nVert + 1];
  for (int i = 0; i <= nVert; i++) {
    deg[i] = 0;
    dist[i] = 0;
  }
  if (nVert < diam + 1) {
    cout << "NO";
    return 0;
  }
  for (int i = 1; i <= diam; i++) {
    e.push_back(newEdge(i, i + 1));
    deg[i]++, deg[i + 1]++;
  }
  for (int l = 1, r = diam + 1, len = diam / 2; l <= r; l++, len--, r--)
    dist[l] = dist[r] = len;
  int n = diam + 1;
  for (int i = 1; i <= n; i++) {
    if (dist[i] == diam / 2) continue;
    while (n < nVert && deg[i] < degree) {
      e.push_back(newEdge(i, n + 1));
      deg[i]++, deg[n + 1]++;
      dist[n + 1] = dist[i] + 1;
      n++;
    }
  }
  if (n != nVert) {
    cout << "NO";
    return 0;
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < e.size(); i++)
      cout << e[i]->a << " " << e[i]->b << endl;
  }
  return 0;
}
