#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> e;
int ne, n, d, k;
vector<int> maxi;
void dfs(int v, int maxi, int till) {
  if (ne > n || maxi == 0) return;
  for (int i = 1; i <= till && ne <= n; i++) {
    e.push_back({v, ne});
    dfs(ne++, maxi - 1, k - 1);
  }
}
int main() {
  cin >> n >> d >> k;
  if (d + 1 > n || (k == 0 && d > 0) || (k == 1 && n > 2))
    cout << "NO" << endl;
  else {
    for (int i = 1; i <= d; i++) e.push_back({i, i + 1});
    ne = d + 2;
    maxi = vector<int>(d + 2);
    int i, j, k = 0;
    for (i = 1, j = d + 1; i <= j; i++, j--) {
      maxi[i] = maxi[j] = k++;
    }
    for (i = 1; i <= d + 1; i++) dfs(i, maxi[i], k - 2);
    if (ne <= n)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int i = 0; i < e.size(); i++)
        cout << e[i].first << " " << e[i].second << "\n";
    }
  }
}
