#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 10;
vector<pair<int, int> > ans;
int n, k, d;
int tot;
void dfs(int u, int curd, int maxd) {
  if (curd == maxd) return;
  for (int i = 1; i <= k - 1 - (curd == 0); ++i) {
    ans.push_back(make_pair(u, ++tot));
    if (tot == n) break;
    dfs(tot, curd + 1, maxd);
  }
}
int main() {
  scanf("%d %d %d", &n, &d, &k);
  if (n - 1 < d || (k == 1 && d > 1)) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= d; ++i) {
    ans.push_back(make_pair(i, i + 1));
  }
  tot += d + 1;
  for (int i = 2; i <= d; ++i) {
    dfs(i, 0, min(i - 1, d + 1 - i));
  }
  if (tot != n)
    puts("NO");
  else {
    puts("YES");
    for (vector<pair<int, int> >::size_type i = 0; i < ans.size(); ++i) {
      printf("%d %d\n", ans[i].first, ans[i].second);
    }
  }
}
