#include <bits/stdc++.h>
using namespace std;
int arr[400010];
int dist[400010];
int main() {
  vector<pair<int, int> > vi;
  int i, j, k, x, y, temp, n, bad, d, cnt = 0;
  int ans = 1;
  int node = 0;
  int awal = 1;
  scanf("%d %d %d", &n, &d, &k);
  int akhir = d + 1;
  if (n <= d) {
    printf("NO\n");
    return 0;
  }
  for (i = awal; i < akhir; i++) {
    vi.push_back(make_pair(i, i + 1));
    node++;
    if (i > awal && i < akhir)
      arr[i] = 2;
    else
      arr[i] = 1;
    dist[i] = max(i - awal, akhir - i);
    if (arr[i] > k) ans = 0;
  }
  if (ans == 0) {
    printf("NO\n");
    return 0;
  }
  arr[akhir] = 1;
  dist[akhir] = d;
  int curr;
  queue<int> q;
  node = akhir + 1;
  if (node == n + 1) {
    printf("YES\n");
    for (i = 0; i < vi.size(); i++) {
      printf("%d %d\n", vi[i].first, vi[i].second);
    }
    return 0;
  }
  for (i = 2; i < akhir; i++) {
    q.push(i);
    while (!q.empty()) {
      if (node > n) break;
      curr = q.front();
      q.pop();
      while (arr[curr] < k) {
        if (dist[curr] + 1 <= d) {
          vi.push_back(make_pair(curr, node));
          arr[curr]++;
          arr[node]++;
          dist[node] = dist[curr] + 1;
          q.push(node);
          node++;
        } else
          break;
        if (node > n) break;
      }
      if (node > n) break;
    }
    if (node > n) break;
  }
  if (node == n + 1) {
    ans = 1;
  } else
    ans = 0;
  if (ans == 0) {
    printf("NO\n");
  } else {
    printf("YES\n");
    for (i = 0; i < vi.size(); i++) {
      printf("%d %d\n", vi[i].first, vi[i].second);
    }
  }
  return 0;
}
