#include <bits/stdc++.h>
using namespace std;
class Edge {
 public:
  int from, to;
  Edge(int u, int v) : from(u), to(v) {}
  Edge() {}
};
bool solve();
void add_edge(int u, int v);
const int MAX = 4e5 + 5;
int degree[MAX], maxdepth[MAX];
vector<Edge> edges;
int n, d, k;
int main() {
  while (scanf("%d %d %d", &n, &d, &k) != EOF) {
    memset(degree, 0, sizeof(degree));
    memset(maxdepth, 0, sizeof(maxdepth));
    edges.clear();
    bool flag = solve();
    if (flag) {
      printf("YES\n");
      for (int i = 0; i < edges.size(); i++) {
        printf("%d %d\n", edges[i].from, edges[i].to);
      }
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
bool solve() {
  if (n <= d) {
    return false;
  }
  if (n > 2 && k < 2) {
    return false;
  }
  int num = 1;
  for (int i = 1; i <= d; i++) {
    add_edge(num, num + 1);
    if (degree[num] > k || degree[num + 1] > k) {
      return false;
    }
    num++;
  }
  for (int i = 1; i <= num; i++) {
    maxdepth[i] = max(i - 1, d - (i - 1));
  }
  int u = 1;
  for (int i = 1; i <= n - 1 - d;) {
    if (degree[u] < k && maxdepth[u] < d) {
      add_edge(u, num + 1);
      maxdepth[num + 1] = maxdepth[u] + 1;
      num++;
      i++;
      if (num > n) return false;
    } else {
      u++;
      if (u > num) return false;
    }
  }
  return true;
}
inline void add_edge(int u, int v) {
  edges.push_back(Edge(u, v));
  degree[u]++;
  degree[v]++;
}
