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