#include <bits/stdc++.h>
using namespace std;
long long inf = 2147483647;
const long long ll = 9223372036854775807, ninf = 1000000000;
const double eps = 1e-6;
const long long nll = 1000000000000000000;
int deg[1000005] = {};
vector<pair<int, int> > ans;
int a, b, c;
int now = 0;
void dfs(int x, int d) {
  if (d >= b) return;
  if (x > a) return;
  if (deg[x] >= c) return;
  if (ans.size() >= a - 1) return;
  if (now <= a) {
    while (deg[x] < c) {
      ans.push_back(make_pair(x, now++));
      if (now > a) break;
      deg[x]++;
      deg[now - 1]++;
      dfs(now - 1, d + 1);
    }
  }
}
int main() {
  while (cin >> a >> b >> c) {
    if (b >= a || (b > 1 && (c < 2))) {
      cout << "NO" << '\n';
      continue;
    }
    for (int i = 1; i <= b; i++) {
      ans.push_back(make_pair(i, i + 1));
      deg[i]++;
      deg[i + 1]++;
    }
    now = b + 2;
    for (int i = 2; i <= a - 1; i++) {
      dfs(i, max(i - 1, b - i + 1));
    }
    if (ans.size() < a - 1) {
      cout << "NO" << '\n';
      continue;
    }
    cout << "YES" << '\n';
    for (int i = 0; i < a - 1; i++) {
      cout << ans[i].first << " " << ans[i].second << '\n';
    }
  }
  return 0;
}
