#include <bits/stdc++.h>
using namespace std;
int n, k, cur;
int cNode() { return cur++; }
vector<pair<int, int> > ans;
void dfs(int u, int deg, int l) {
  if (!l) return;
  for (int i = 0; i < deg; i++) {
    int v = cNode();
    if (v >= n) return;
    ans.push_back({u, v});
    dfs(v, k - 1, l - 1);
  }
}
int main() {
  int d;
  cin >> n >> d >> k;
  if (n == 1) {
    puts("NO");
    return 0;
  }
  if (n == 2) {
    if (d == 1)
      puts("YES\n1 2");
    else
      puts("NO");
    return 0;
  }
  if (k < 2 || d >= n) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i < d; i++) ans.push_back({i, i + 1});
  ans.push_back({d, n});
  cur = d + 1;
  for (int i = 2; i <= d; i++) dfs(i, k - 2, min(i - 1, d - i + 1));
  if (int(ans.size()) == n - 1) {
    puts("YES");
    for (auto it : ans) cout << it.first << " " << it.second << endl;
  } else
    puts("NO");
}
