#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int M = 2e5 + 20;
const int N = 4e5 + 20;
int n, d, k, num, idx;
vector<int> g[N];
void dfs(int u, int fa, int dep) {
  if (dep == 0) return;
  int nxt = k - 1;
  if (fa == -1) nxt--;
  for (int i = 1; i <= nxt; i++) {
    g[u].push_back(idx);
    num--;
    idx++;
    if (num == 0) return;
  }
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v > d + 1) {
      dfs(v, u, dep - 1);
      if (num == 0) return;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> d >> k;
  if (n == 2 && d == 1) {
    cout << "YES" << endl;
    cout << "1 2" << endl;
    return 0;
  }
  if (d >= n || k == 1) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    g[i].push_back(i + 1);
  }
  num = n;
  num -= d + 1;
  idx = d + 2;
  for (int i = 2; i <= d; i++) {
    if (num > 0) dfs(i, -1, min(i - 1, d + 1 - i));
  }
  if (num > 0) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    for (unsigned j = 0; j < g[i].size(); j++) {
      cout << i << ' ' << g[i][j] << endl;
    }
  }
  return 0;
}
