#include <bits/stdc++.h>
const int INFI = (1 << 29);
const long long INFL = (1LL << 62);
using namespace std;
long long n, d, k, disp = 1, id = 1;
vector<vector<long long> > adj;
void DFS(long long nodo, long long dIzq, long long dDer, long long no) {
  if ((id > n) || (dIzq == d) || (dDer == d)) return;
  while (((int(adj[nodo].size()) + 1) < k) && (id <= n)) {
    adj[nodo].push_back(id);
    id++;
  }
  for (long long i : adj[nodo])
    if (i != no) DFS(i, (dIzq + 1), (dDer + 1), no);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  adj.resize(n + 1);
  for (long long i = 2; i <= min((d + 1), n); i++) {
    adj[id].push_back(i);
    id++;
  }
  id++;
  for (long long i = 2; i <= (min((d + 1), n) - 1); i++) {
    DFS(i, (i - 1), (min((d + 1), n) - i), (i + 1));
    disp++;
  }
  if (id <= n)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (long long i = 1; i <= n; i++)
      for (long long j = 0; j < int(adj[i].size()); j++)
        cout << i << " " << adj[i][j] << "\n";
  }
  return 0;
}
