#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
vector<vector<int> > g;
void dfs(int u, int p = -1) {
  for (int v : g[u]) {
    if (v == p) continue;
    cout << v + 1 << " " << u + 1 << "\n";
    dfs(v, u);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, d, k;
  cin >> n >> d >> k;
  g.assign(n, vector<int>());
  int nxt = d;
  if (d > n - 1 || (d > 1 && k == 1)) {
    cout << "NO\n";
    return 0;
  }
  vector<int> dis(n, 3 * n);
  unordered_set<int> st;
  for (int i = 0; i < d; ++i) {
    g[i].push_back(i + 1);
    g[i + 1].push_back(i);
    dis[i] = min(i, d - i);
  }
  dis[d] = 0;
  for (int i = 0; i <= d; i++) {
    if (dis[i] && g[i].size() < k) st.insert(i);
  }
  for (int u = d + 1; u < n; ++u) {
    if (!st.size()) {
      cout << "NO\n";
      return 0;
    }
    int v = *st.begin();
    st.erase(v);
    g[v].push_back(u);
    g[u].push_back(v);
    dis[u] = dis[v] - 1;
    if (g[v].size() < k) st.insert(v);
    if (g[u].size() < k && dis[u]) st.insert(u);
  }
  cout << "YES\n";
  dfs(0);
}
