#include <bits/stdc++.h>
long long inf = 1LL << 62;
long long mod = 1000000007;
using namespace std;
int n, k, d, label;
int seen[400010], out[400010];
vector<int> g[400010];
void dfs(int cur, int depth) {
  if (depth == 0 || label == n + 1 || seen[cur]) return;
  seen[cur] = 1;
  for (int i = 0; i < out[cur]; i++) {
    if (label == n + 1) return;
    g[cur].push_back(label);
    g[label].push_back(cur);
    out[label]--;
    label++;
  }
  for (int i = 0; i < g[cur].size(); i++) {
    if (!seen[g[cur][i]]) dfs(g[cur][i], depth - 1);
  }
}
void print(int cur, int par) {
  for (int i = 0; i < g[cur].size(); i++) {
    if (g[cur][i] != par)
      cout << cur << " " << g[cur][i] << endl, print(g[cur][i], cur);
  }
}
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  if (d > n) {
    cout << "NO";
    return 0;
  }
  for (int i = 1; i <= n; i++) out[i] = k;
  for (int i = 1; i <= d; i++) {
    out[i]--, out[i + 1]--;
    seen[i] = seen[i + 1] = 1;
    if (out[i] < 0 || out[i + 1] < 0) {
      cout << "NO";
      return 0;
    }
    g[i].push_back(i + 1);
    g[i + 1].push_back(i);
  }
  label = d + 2;
  for (int i = 1; i <= d + 1; i++) {
    int depth = min(i - 1, d + 1 - i);
    if (label == n + 1) break;
    seen[i] = 0;
    dfs(i, depth);
  }
  if (label < n + 1) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  print(1, 0);
  return 0;
}
