#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > edges;
struct node {
  int id;
  int degree;
  int level;
  node(int a, int b, int c) {
    id = a;
    degree = b;
    level = c;
  }
  node() {
    id = 0;
    degree = 0;
    level = 0;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, d, k;
  cin >> n >> d >> k;
  ++d;
  if (d == 1 && n == 2) {
    cout << "YES\n1 2";
    return 0;
  }
  if (k < 2) {
    cout << "NO";
    return 0;
  }
  if (n < d) {
    cout << "NO";
    return 0;
  }
  for (int i = (2); i < (d + 1); ++i) {
    edges.push_back(make_pair(i - 1, i));
  }
  queue<node> bfs;
  if (d & 1) {
    bfs.push(node((d + 1) / 2, 2, d / 2));
    int x = 1;
    for (int i = (d + 1) / 2 - 1; i > 1; --i) {
      bfs.push(node(i, 2, d / 2 - x));
      ++x;
    }
    x = 1;
    for (int i = ((d + 1) / 2 + 1); i < (d); ++i) {
      bfs.push(node(i, 2, d / 2 - x));
      ++x;
    }
  } else {
    bfs.push(node(d / 2, 2, d / 2 - 1));
    bfs.push(node(d / 2 + 1, 2, d / 2 - 1));
    int x = 1;
    for (int i = d / 2 - 1; i > 1; --i) {
      bfs.push(node(i, 2, d / 2 - 1 - x));
      ++x;
    }
    x = 1;
    for (int i = (d / 2 + 2); i < (d); ++i) {
      bfs.push(node(i, 2, d / 2 - 1 - x));
      ++x;
    }
  }
  int last = d + 1;
  int left = n - d;
  while (left) {
    if (bfs.empty()) {
      cout << "NO";
      return 0;
    }
    auto v = bfs.front();
    bfs.pop();
    if (!v.level) {
      continue;
    }
    for (int i = (v.degree); i < (k); ++i) {
      if (!left) {
        break;
      }
      edges.push_back(make_pair(v.id, last));
      if (v.level > 1) {
        bfs.push(node(last, 1, v.level - 1));
      }
      ++last;
      --left;
    }
  }
  cout << "YES\n";
  for (auto& i : edges) {
    cout << i.first << " " << i.second << "\n";
  }
  return 0;
}
