#include <bits/stdc++.h>
using namespace std;
const int maxN = 4e5 + 9;
int n, d, m;
int cnt;
struct Node {
  int u, v;
  Node(){};
  Node(int _u, int _v) { u = _u, v = _v; }
};
vector<Node> tree;
void dfs(int pos, int depth) {
  int cur = cnt + 1;
  if (depth <= 0 || cnt == n) return;
  tree.push_back(Node(pos, ++cnt));
  depth--;
  if (depth <= 0 || cnt == n) return;
  for (int i = 1; i < m; i++) dfs(cur, depth);
}
int main() {
  scanf("%d %d %d", &n, &d, &m);
  if (n < d + 1) {
    puts("NO");
    return 0;
  }
  for (int i = 2; i <= d + 1; i++) {
    tree.push_back(Node(i, i - 1));
  }
  cnt = d + 1;
  for (int i = 2; i <= d; i++) {
    for (int j = 0; j < m - 2; j++) {
      dfs(i, min(i - 1, d + 1 - i));
      if (cnt == n) break;
    }
    if (cnt == n) break;
  }
  if (cnt < n)
    puts("NO");
  else {
    puts("YES");
    for (int i = 0; i < tree.size(); i++)
      printf("%d %d\n", tree[i].u, tree[i].v);
  }
  return 0;
}
