#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed;
  cout.precision(10);
  if (fopen("joke.in", "r")) {
    freopen("joke.in", "r", stdin);
    freopen("joke.out", "w", stdout);
  }
  int n, d, k;
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO";
    return 0;
  }
  vector<int> deg(n + 1, 0);
  vector<pair<int, int>> edges;
  set<pair<int, int>> st;
  for (int i = 1; i <= d + 1; ++i) {
    if (i < d + 1) {
      ++deg[i];
      ++deg[i + 1];
      edges.push_back(make_pair(i, i + 1));
    }
    int maxdist = max(i - 1, d - i + 1);
    if (maxdist < d) {
      st.insert(make_pair(maxdist, i));
    }
  }
  for (int i = d + 2; i <= n; ++i) {
    if (st.empty()) {
      cout << "NO";
      return 0;
    }
    auto mn = *st.begin();
    st.erase(st.begin());
    if (mn.first == d) {
      cout << "NO";
      return 0;
    }
    edges.push_back(make_pair(mn.second, i));
    ++deg[mn.second];
    ++deg[i];
    if (deg[mn.second] < k) {
      st.insert(mn);
    }
    if (deg[i] < k) {
      st.insert(make_pair(mn.first + 1, i));
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n - 1; ++i) {
    cout << edges[i].first << " " << edges[i].second << endl;
  }
  return 0;
}
