#include <bits/stdc++.h>
using namespace std;
void FastIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long pow(long long B, long long P) {
  long long S = 1;
  for (long long i = 1; i <= P; i++) S = S * B;
  return S;
}
int fx4[] = {1, -1, 0, 0};
int fy4[] = {0, 0, 1, -1};
set<pair<int, int> > edges;
int degree[500000], depth[500000];
int N, D, K;
void build() {
  for (int i = 1; i <= D; i++) {
    edges.insert(make_pair(i, i + 1));
    degree[i]++;
    degree[i + 1]++;
    depth[i + 1] = depth[i] + 1;
  }
}
int V;
void tree(int parent) {
  if (depth[parent] >= D || degree[parent] >= K || V >= N) return;
  int K1 = degree[parent];
  if (depth[parent] < D && degree[parent] < K) {
    for (int i = K1; i < K; i++) {
      degree[parent]++;
      V++;
      if (V > N) return;
      degree[V]++;
      depth[V] = depth[parent] + 1;
      edges.insert(make_pair(parent, V));
      if (depth[V] < D) tree(V);
    }
  }
}
int main() {
  FastIO();
  cin >> N >> D >> K;
  if (D >= N) {
    cout << "NO" << endl;
    return 0;
  }
  if (K == 1 && N > 2) {
    cout << "NO" << endl;
    return 0;
  }
  build();
  V = D + 1;
  for (int i = 2; i <= D; i++) {
    int D1 = max(depth[i] - depth[1], depth[D + 1] - depth[i]);
    depth[i] = D1;
    tree(i);
  }
  if (edges.size() < N - 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (auto it = edges.begin(); it != edges.end(); it++) {
    cout << it->first << " " << it->second << endl;
  }
  return 0;
}
