#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int MOD = 1000000007;
const long long INF = 1e18 + 1;
const int inf = 1e9 + 1;
const double PI = acos(-1);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, -1, 1, 1, -1};
const int MAX = 310000;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int n, d, k;
  cin >> n >> d >> k;
  if (n < d + 1) {
    cout << "NO" << '\n';
    return 0;
  }
  if (n == 1) {
    cout << "NO" << '\n';
    return 0;
  }
  if (n == 2) {
    if (k >= 1 && d == 1) {
      cout << "YES" << '\n';
      cout << 1 << " " << 2 << '\n';
    } else
      cout << "NO" << '\n';
    return 0;
  }
  if (k == 1) {
    if (n == 2 && d == 1) {
      cout << "YES" << '\n';
      cout << 1 << " " << 2 << '\n';
    } else
      cout << "NO" << '\n';
    return 0;
  }
  if (k == 2) {
    if (n == d + 1) {
      cout << "YES" << '\n';
      for (long long i = 0; i < n - 1; ++i) {
        cout << i + 1 << " " << i + 2 << '\n';
      }
    } else
      cout << "NO" << '\n';
    return 0;
  } else {
    vector<pair<int, int> > p;
    for (long long i = 0; i < d; ++i) {
      p.emplace_back(i + 1, i + 2);
    }
    int res = n - (d + 1);
    if (res == 0) {
      cout << "YES" << '\n';
      for (auto [x, y] : p) {
        cout << x << " " << y << '\n';
      }
      return 0;
    }
    stack<pair<int, int> > st;
    int cnt = d + 2;
    for (long long i = 1; i <= d - 1; ++i) {
      int D = max(abs(i - 0), abs(d - i));
      for (long long j = 0; j < k - 2; ++j) {
        st.push(pair<int, int>(cnt, D + 1));
        p.emplace_back(i + 1, cnt);
        cnt++;
        res--;
        if (res == 0) {
          cout << "YES" << '\n';
          for (auto [x, y] : p) {
            cout << x << " " << y << '\n';
          }
          return 0;
        }
      }
    }
    while (res && !st.empty()) {
      auto [id, D] = st.top();
      st.pop();
      if (D == d) continue;
      for (long long j = 0; j < k - 1; ++j) {
        st.push(pair<int, int>(cnt, D + 1));
        p.emplace_back(id, cnt);
        cnt++;
        res--;
        if (res == 0) {
          cout << "YES" << '\n';
          for (auto [x, y] : p) {
            cout << x << " " << y << '\n';
          }
          return 0;
        }
      }
    }
    if (res == 0) {
      cout << "YES" << '\n';
      for (auto [x, y] : p) {
        cout << x << " " << y << '\n';
      }
      return 0;
    }
    cout << "NO" << '\n';
  }
  return 0;
}
