#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3LL;
const long long mod = (long long)1e9 + 7;
using namespace std;
template <class T, class T2>
void smin(T& a, T2 val) {
  if (a > val) a = val;
}
template <class T, class T2>
void smax(T& a, T2 val) {
  if (a < val) a = val;
}
const long long N = 5 * (long long)1e5 + 10;
long long n, d, k, dist[N], deg[N];
vector<array<long long, 2>> v;
void yes() { cout << "YES" << '\n'; }
void no() {
  cout << "NO" << '\n';
  exit(0);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> d >> k;
  if (d >= n) {
    no();
  }
  for (long long i = 1; i <= d; ++i) {
    deg[i]++;
    deg[i + 1]++;
    v.push_back({i, i + 1});
  }
  long long curr = d;
  for (long long i = 1, j = d + 1; i <= j; ++i, --j) {
    dist[i] = dist[j] = curr;
    curr--;
  }
  for (long long i = 1; i <= n; ++i) {
    ;
  }
  curr = d + 2;
  for (long long i = 1; i <= n; ++i) {
    if (dist[i] >= d or deg[i] >= k or i >= curr) {
      continue;
    }
    while (curr <= n and dist[i] + 1 <= d and deg[i] < k) {
      dist[curr] = dist[i] + 1;
      ;
      deg[curr]++;
      deg[i]++;
      v.push_back({curr, i});
      ++curr;
    }
  }
  for (long long i = 1; i <= n; ++i) {
    ;
  };
  if (curr <= n or *max_element(dist, dist + n + 1) > d or
      *max_element(deg, deg + n + 1) > k) {
    no();
  }
  yes();
  for (auto it : v) {
    cout << it[0] << " " << it[1] << '\n';
  }
  return 0;
}
