#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 7;
int n, d, k, i, j, x, in[N], sz;
vector<pair<int, int> > e;
void dfs(int x, int num) {
  if (num == 0) return;
  for (; in[x] < k && n;) {
    n--;
    in[x]++;
    ++sz;
    in[sz]++;
    e.push_back({x, sz});
    dfs(sz, num - 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> d >> k;
  if (d > n - 1 || (k == 1 && (d != 1 || n != 2)))
    puts("NO");
  else {
    for (i = 1; i <= d; ++i) e.push_back({i, i + 1}), in[i]++, in[i + 1]++;
    n -= d + 1;
    sz = d + 1;
    for (x = (d + 1) / 1, i = 2; i <= d; ++i) dfs(i, min(i - 1, d + 1 - i));
    if (n)
      puts("NO");
    else {
      puts("YES");
      for (auto& x : e) printf("%d %d\n", x.first, x.second);
    }
  }
}
