#include <bits/stdc++.h>
using namespace std;
int power(int x, unsigned int y, unsigned int m) {
  if (y == 0) return 1;
  int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
int modInverse(int a, int m) { return power(a, m - 2, m); }
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t-- > 0) {
    int n = 0, d = 0, r = 0;
    cin >> n >> d >> r;
    if (n <= d)
      cout << "NO";
    else {
      vector<pair<int, int> > edges;
      set<pair<int, int> > s;
      vector<int> degrees(n, 0);
      for (int i = 0; i < d; ++i) {
        edges.push_back({i, i + 1});
        int y = max(i, d - i);
        s.insert({y, i});
        degrees[i]++;
        degrees[i + 1]++;
        if (degrees[i] > r || degrees[i + 1] > r) {
          cout << "NO";
          return 0;
        }
      }
      for (int i = d + 1; i < n; i++) {
        while (!s.empty() && degrees[s.begin()->second] == r)
          s.erase(s.begin());
        if (s.empty() || s.begin()->first == d) {
          cout << "NO";
          return 0;
        }
        degrees[i]++;
        degrees[s.begin()->second]++;
        s.insert({s.begin()->first + 1, i});
        edges.push_back({s.begin()->second, i});
      }
      cout << "YES\n";
      for (int i = 0; i < n - 1; ++i) {
        cout << edges[i].first + 1 << " " << edges[i].second + 1 << endl;
      }
    }
  }
  return 0;
}
