#include <bits/stdc++.h>
using namespace std;
int n, deg[400010], k, d;
set<pair<int, int> > st;
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> d >> k;
  if (d > n - 1) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < d; ++i) {
    ans.push_back({i, i + 1});
    ++deg[i];
    ++deg[i + 1];
    if (deg[i] > k or deg[i + 1] > k) {
      cout << "NO\n";
      return 0;
    }
  }
  for (int i = 0; i <= d; ++i) {
    st.insert({max(i, d - i), i});
  }
  for (int i = d + 1; i < n; ++i) {
    while (!st.empty() and
           (st.begin()->first >= d or deg[st.begin()->second] >= k)) {
      st.erase(st.begin());
    }
    if (st.empty()) {
      cout << "NO\n";
      return 0;
    }
    deg[st.begin()->second]++;
    deg[i]++;
    ans.push_back({i, st.begin()->second});
    st.insert({st.begin()->first + 1, i});
  }
  cout << "YES\n";
  for (int i = 0; i < n - 1; ++i) {
    cout << ans[i].first + 1 << " " << ans[i].second + 1 << "\n";
  }
}
