#include <bits/stdc++.h>
long long expow(long long a, long long b, long long p) {
  long long v = 1;
  for (; b; b >>= 1, a = a * a % p)
    if (b & 1) v = v * a % p;
  return v;
}
long long inv(long long a, long long p) { return expow(a, p - 2, p); }
using namespace std;
const int N = 400000 + 10;
vector<pair<int, int> > w;
int dd[N];
int main() {
  int n, d, k;
  scanf("%d%d%d", &n, &d, &k);
  if (d == 2) {
    if (n == 2)
      cout << "1 2" << endl;
    else
      cout << "-1" << endl;
    return 0;
  }
  int gg = min(n, d);
  for (int j = 2; j <= gg; j++) {
    w.push_back(make_pair(j - 1, j));
    dd[j - 1]++;
    dd[j]++;
  }
  int cnt = 1, tot = gg + 1;
  for (int j = 1; j <= gg; j++) {
    bool f = false;
    cnt = min(cnt, d / 2);
    if (dd[j] <= k) {
      int add = cnt * (k - dd[j]);
      for (int q = 1; q <= add; q++) {
        if (tot == n + 1) {
          f = true;
          break;
        }
        w.push_back(make_pair(j, tot));
        tot++;
      }
      dd[j] = k;
    }
    if (gg % 2 == 0) {
      if (j < gg / 2) cnt++;
      if (j > gg / 2) cnt--;
    } else {
      if (j <= gg / 2)
        cnt++;
      else
        cnt--;
    }
    if (f) break;
  }
  if (tot != n + 1) {
    cout << "-1" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int j = 0; j < (int)w.size(); j++)
    cout << w[j].first << " " << w[j].second << endl;
  return 0;
}
