#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
enum { MOD0 = 1000000000, MOD7 = 1000000007, MOD9 = 1000000009 };
int n, d, k;
vector<int> g[400000];
int cc = 0;
void no() {
  cout << "NO" << '\n';
  exit(0);
}
void dfs(int x, int depth) {
  if (!depth) {
    return;
  }
  int create = min(n, k - (int)g[x].size());
  n -= create;
  for (int i = 0; i < create; ++i) {
    g[x].push_back(cc);
    g[cc].push_back(x);
    cc++;
    dfs(cc - 1, depth - 1);
  }
}
void dfs_ans(int x, int p = -1) {
  for (const int &to : g[x]) {
    if (to == p) continue;
    cout << x + 1 << " " << to + 1 << '\n';
    dfs_ans(to, x);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> d >> k;
  if (n < d + 1) {
    no();
  }
  if (k == 1) {
    if (n == 2) {
      cout << "YES" << '\n';
      cout << "1 2" << '\n';
      return 0;
    } else {
      no();
    }
  }
  for (int i = 0; i < d; ++i) {
    g[i].push_back(i + 1);
    g[i + 1].push_back(i);
  }
  cc = d + 1;
  n -= d + 1;
  for (int i = 1; i < d; ++i) {
    dfs(i, min(i, d - i));
  }
  if (!n) {
    cout << "YES" << '\n';
    dfs_ans(0);
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
