#include <bits/stdc++.h>
using namespace std;
int deg[400010];
int main() {
  int n, d, k;
  scanf("%d%d%d", &n, &d, &k);
  vector<pair<int, int> > ans;
  set<pair<int, int> > q;
  if (k >= n) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    ans.push_back(make_pair(i, i + 1));
    deg[i]++;
    deg[i + 1]++;
    if (deg[i] > k || deg[i + 1] > k) {
      puts("NO");
      return 0;
    }
  }
  for (int i = 0; i <= d; i++) q.insert(make_pair(max(i, d - i), i + 1));
  for (int i = d + 2; i <= n; i++) {
    while (!q.empty() && deg[q.begin()->second] == k) q.erase(q.begin());
    if (q.empty() || q.begin()->first == d) {
      puts("NO");
      return 0;
    }
    ans.push_back(make_pair(i, q.begin()->second));
    ++deg[i];
    ++deg[q.begin()->second];
    q.insert(make_pair(q.begin()->first + 1, i));
  }
  puts("YES");
  for (int i = 0; i < n - 1; i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
