#include <bits/stdc++.h>
using namespace std;
int N, M, K, L, Q;
struct Stem {
  int index, dist, ind;
};
queue<Stem> que;
vector<pair<int, int> > RET;
void __solve() {
  cin >> N >> M >> K;
  if (N > 2 && K == 1) {
    cout << "NO";
    return;
  }
  int cur = 0;
  int dist = 0;
  int nn = N - 1;
  for (int i = 0; i <= min(M, nn); i++) {
    que.push({cur, dist, 2});
    if (cur) {
      RET.push_back({cur - 1, cur});
    }
    cur++;
    N--;
    if (M % 2) {
      if (i == M / 2)
        ;
      else if (i < M / 2)
        dist++;
      else
        dist--;
    } else {
      if (i < M / 2)
        dist++;
      else
        dist--;
    }
  }
  while (!que.empty() && N) {
    auto par = que.front();
    que.pop();
    if (par.dist <= 0 || par.ind >= K) continue;
    int here = cur++;
    que.push({here, par.dist - 1, 1});
    que.push({par.index, par.dist, par.ind + 1});
    RET.push_back({par.index, here});
    N--;
  }
  if (N) {
    cout << "NO";
    return;
  }
  cout << "YES"
       << "\n";
  for (auto x : RET) cout << x.first + 1 << " " << x.second + 1 << "\n";
}
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  __solve();
  cin >> N;
}
