#include <bits/stdc++.h>
#pragma GCC optimize "Ofast"
#pragma GCC optimize "unroll-loops"
#pragma GCC target "sse,sse2,sse3,sse4,abm,avx,mmx,popcnt,tune=native"
using namespace std;
class Debugger {
 public:
  Debugger(const std::string& _separator = " - ")
      : first(true), separator(_separator) {}
  template <typename ObjectType>
  Debugger& operator,(const ObjectType& v) {
    if (!first)
    std:
      cerr << separator;
    std::cerr << v;
    first = false;
    return *this;
  }
  ~Debugger() {
  std:
    cerr << endl;
  }

 private:
  bool first;
  std::string separator;
};
long long int n, k, d;
set<pair<long long int, long long int> > ans;
long long int s;
void dfs(long long int u, long long int dad, long long int d,
         long long int rem) {
  ans.insert({dad, u});
  if (d) {
    for (long long int i = 0; i < rem && s < n; i++) dfs(++s, u, d - 1, k - 1);
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  if (n <= d || d > 1 && k < 2) {
    cout << "NO";
    return 0;
  }
  for (s = 1; s <= d; s++) ans.insert({s, s + 1});
  for (long long int i = 2; i <= d && s < n; i++) {
    dfs(i, i - 1, min(i - 1, d + 1 - i), k - 2);
  }
  if (s < n) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (auto it : ans) cout << it.first << " " << it.second << '\n';
  return 0;
}
