#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& o, const pair<T, U>& x) {
  o << "(" << x.first << ", " << x.second << ")";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const vector<T>& x) {
  o << "[";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "]";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const set<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const multiset<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const unordered_set<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const unordered_multiset<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const map<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const multimap<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const unordered_map<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const unordered_multimap<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
double time() { return double(clock()) / CLOCKS_PER_SEC; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, d, k;
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO" << endl;
    return 0;
  }
  vector<vector<int>> A(n);
  vector<int> x(n, -1);
  x[0] = d;
  for (int i = 1; i <= d; i++) {
    x[i] = max(abs(i - 0), abs(i - d));
    A[i].push_back(i - 1);
    A[i - 1].push_back(i);
  }
  queue<int> Q;
  for (int i = 1; i < d; i++) {
    Q.push(i);
  }
  int m = d + 1;
  while (!Q.empty() and m < n) {
    auto nxt = Q.front();
    Q.pop();
    if (x[nxt] >= d) continue;
    for (int i = (int)(A[nxt]).size(); i < k and m < n; i++) {
      A[nxt].push_back(m);
      A[m].push_back(nxt);
      x[m] = x[nxt] + 1;
      Q.push(m);
      m++;
    }
  }
  if (m == n) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      for (auto& a : A[i]) {
        if (i < a) {
          cout << i + 1 << ' ' << a + 1 << endl;
        }
      }
    }
  } else {
    cout << "NO" << endl;
  }
}
