#include <bits/stdc++.h>
using namespace std;
set<pair<int, int>> e;
int k, n, d, CLK;
void dfs(int u, int dad, int d, int siz) {
  if (u > n) return;
  e.insert({min(u, dad), max(u, dad)});
  if (d)
    for (int i = 0; i < siz && CLK < n; ++i) dfs(++CLK, u, d - 1, k - 1);
}
int main() {
  cin >> n >> d >> k;
  if (n <= d || d > 1 && k < 2) return cout << "NO", 0;
  for (CLK = 1; CLK <= d; ++CLK) e.insert({CLK, CLK + 1});
  for (int i = 2; i <= d && CLK < n; ++i)
    dfs(i, i - 1, min(i - 1, d + 1 - i), k - 2);
  if (CLK < n) return 0 * puts("NO");
  puts("YES");
  for (auto i : e) printf("%d %d\n", i.first, i.second);
}
