#include <bits/stdc++.h>
using namespace std;
const long long N = 4e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
int n;
int d;
int k;
int u;
int deg[N];
vector<pair<int, int> > ans;
void dfs(int v, int deep) {
  if (deep == 0) {
    return;
  }
  int k2 = k - deg[v];
  while (k2-- > 0 && u != n) {
    if (deg[v] < k && deg[u] < k) {
      deg[v]++, deg[u]++;
      ans.push_back({v, ++u});
      dfs(u, deep - 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> d >> k;
  if (d >= n || (k == 1 && d > 2)) {
    cout << "NO";
    return 0;
  }
  u = d + 1;
  for (int i = 1; i <= d; i++) {
    deg[i]++;
    deg[i + 1]++;
    ans.push_back({i, i + 1});
  }
  for (int i = 2; i <= d; i++) {
    dfs(i, min(i - 1, d - i + 1));
  }
  if (u != n) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (auto x : ans) {
    cout << x.first << " " << x.second << "\n";
  }
}
