#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};
int level[500000], degree[500000];
int N, D, K;
set<pair<int, int> > edges;
void form(int U) {
  degree[U]++;
  if (U < N && level[U] < D) {
    edges.insert(make_pair(U, U + 1));
    level[U + 1] = level[U] + 1;
    degree[U + 1]++;
    form(U + 1);
  }
}
int node;
void tree(int parent, int D1) {
  degree[parent]++;
  for (int i = D1; i <= D; i++) {
    if (level[parent] < D && parent < N && node <= N && degree[parent] <= K) {
      edges.insert(make_pair(parent, node));
      degree[node]++;
      level[node] = level[parent] + 1;
      node++;
      tree(node - 1, degree[node - 1]);
    }
  }
}
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;
  }
  form(1);
  degree[D + 1]--;
  node = D + 2;
  for (int i = 2; i <= D; i++) {
    int D1 = max(level[i] - level[1], level[D + 1] - level[i]);
    level[i] = D1;
    tree(i, degree[i]);
  }
  int ans = edges.size();
  if (ans < 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;
}
