#include <bits/stdc++.h>
using namespace std;
bool vis[400005];
vector<int> adj[400005];
int n, d, k, cnt, dist[400005];
int main() {
  scanf("%d%d%d", &n, &d, &k);
  cnt = n - 1;
  if (n < d) {
    printf("NO\n");
    return 0;
  }
  dist[1] = 1;
  for (int i = 1; i < d; i++) {
    adj[i].push_back(i + 1);
    adj[i + 1].push_back(i);
    dist[i + 1] = dist[i] + 1;
    cnt--;
  }
  int cur = 1, nxt = d + 1;
  while (nxt <= n && cnt > 0 && cur <= n) {
    if (dist[cur] < d && dist[cur] != 0) {
      while (adj[cur].size() < k && cnt > 0) {
        dist[nxt] = dist[cur] + 1;
        adj[cur].push_back(nxt);
        adj[nxt++].push_back(cur);
        cnt--;
      }
    }
    if (cnt == 0) break;
    cur++;
  }
  if (cnt > 0) {
    printf("NO\n");
  } else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      if (vis[i]) continue;
      for (int j = 0; j < adj[i].size(); j++) {
        printf("%d %d\n", i, adj[i][j]);
        vis[adj[i][j]] = true;
      }
    }
  }
}
