#include <bits/stdc++.h>
using namespace std;
int _I() {
  int x;
  scanf("%d", &x);
  return x;
}
int _case = 1;
int degree[400001];
int dis[400001];
void solve() {
  int n = _I();
  int d = _I();
  int k = _I();
  if (k == 1 && n > 2) {
    printf("NO\n");
    return;
  }
  vector<pair<int, int> > ans;
  queue<int> q;
  int nxt;
  for (int i = 1; i <= n; i++) degree[i] = k;
  for (int i = 1; i <= d; i++) {
    dis[i] = max(i - 1, d - i + 1);
    ans.push_back({i, i + 1});
    degree[i]--;
    degree[i + 1]--;
    q.push(i);
    nxt = i + 2;
  }
  while (q.size()) {
    int u = q.front();
    q.pop();
    int c = dis[u] + 1;
    while (c <= d && degree[u] && nxt <= n) {
      if (u == nxt) break;
      dis[nxt] = dis[u] + 1;
      degree[nxt]--;
      degree[u]--;
      q.push(++nxt);
      ans.push_back({u, nxt - 1});
    }
  }
  if (nxt - 1 != n)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < ans.size(); i++) {
      printf("%d %d\n", ans[i].first, ans[i].second);
    }
  }
}
int main() {
  solve();
  return 0;
}
