#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long mod = 1000000007;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const int N = 300100;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve() {
  int n, d, k;
  cin >> n >> d >> k;
  queue<pair<int, int> > q;
  q.push({1, 0});
  vector<pair<int, int> > ans;
  bool ok = false;
  if (d & 1) ok = true, d--;
  int j = 2;
  while (!q.empty()) {
    pair<int, int> a = q.front();
    q.pop();
    int i = a.first, u = a.second;
    if (u == d / 2) break;
    int r = (i == 1 ? k : k - 1);
    if (j - 1 + r > n + d - 2 * u) r = n + d - 2 * u - j + 1;
    for (int l = 0; l < r; l++, j++) {
      ans.push_back({i, j});
      q.push({j, u + 1});
    }
  }
  if (ok) {
    int r = (j == 2 ? k : k - 1);
    r = min(r, n - j + 1);
    int aux = j;
    for (int l = 0; l < r; l++, j++) {
      ans.push_back({aux - 1, j});
    }
    j++;
  }
  if (j <= n) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  for (auto p : ans) cout << p.first << " " << p.second << "\n";
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  ;
  int t_ = 1;
  while (t_--) solve();
  return 0;
}
