#include <bits/stdc++.h>
using namespace std;
int n, d, k, id;
vector<pair<int, int> > ans;
void dfs(int u, int dep, int maxd) {
  if (dep == maxd) return;
  for (int i = 0; i < k - 1 - (dep == 0) && id < n; i++) {
    ans.push_back(make_pair(u, ++id));
    dfs(id, dep + 1, maxd);
  }
}
int main() {
  scanf("%d%d%d", &n, &d, &k);
  if (n <= d || d > 1 && k < 2) return printf("NO\n"), 0;
  for (int i = 1; i <= d; i++) ans.push_back(make_pair(i, i + 1));
  id = d + 1;
  for (int i = 2; i <= d; i++) dfs(i, 0, min(i - 1, d - i + 1));
  if (id < n) return printf("NO\n"), 0;
  printf("YES\n");
  for (auto i : ans) printf("%d %d\n", i.first, i.second);
  return 0;
}
