#include <bits/stdc++.h>
using namespace std;
inline void OPEN(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
const int MAXN = 4e5;
int n, d, k, now;
int ind[MAXN + 5];
vector<pair<int, int> > edge;
void Init() {
  scanf("%d %d %d", &n, &d, &k);
  for (int i = 1; i <= d; i++) {
    edge.push_back(pair<int, int>(i, i + 1));
    ind[i]++, ind[i + 1]++;
  }
}
void Dfs(int u, int fa, int dis) {
  while (now < n && dis != 1 && ind[u] < k) {
    edge.push_back(pair<int, int>(u, ++now));
    ind[u]++, ind[now]++;
    Dfs(now, u, dis - 1);
  }
}
void Solve() {
  now = d + 1;
  for (int i = 1; i <= d + 1; i++) {
    Dfs(i, 0, min(i, d - i + 2));
  }
}
int main() {
  Init();
  Solve();
  bool ok = true;
  if (now != n) ok = false;
  for (int i = 1; i <= n; i++)
    if (ind[i] > k) ok = false;
  if (!ok)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < edge.size(); i++) {
      printf("%d %d\n", edge[i].first, edge[i].second);
    }
  }
  return 0;
}
