#include <bits/stdc++.h>
using namespace std;
int sz, n, k;
vector<int> adj[400005];
void dfs(int u, int deg, int depth) {
  if (!depth) return;
  int i;
  for (i = 0; i < deg and sz < n; i++) {
    sz++;
    adj[u].push_back(sz);
    dfs(sz, k - 1, depth - 1);
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int d, i, j, c;
  cin >> n >> d >> k;
  if (d + 1 > n or (d > 1 and k == 1)) {
    cout << "NO";
    return 0;
  }
  for (i = 1; i <= d; i++) adj[i].push_back(i + 1);
  sz = d + 1;
  for (i = 1, j = d + 1, c = 0; i <= j; i++, j--, c++) {
    dfs(i, k - 2, c);
    if (j != i) dfs(j, k - 2, c);
  }
  if (sz == n) {
    cout << "YES" << '\n';
    for (i = 1; i <= n; i++)
      for (auto x : adj[i]) cout << i << " " << x << '\n';
  } else
    cout << "NO";
  return 0;
}
