#include <bits/stdc++.h>
using namespace std;
int n, d, k;
void output(int v, int depth, int limit, int& cnt) {
  if (depth == limit || cnt >= n) return;
  for (int i = 0; i < k - 1 - (v <= d) && cnt < n; i++) {
    printf("%d %d\n", v, ++cnt);
    output(cnt, depth + 1, limit, cnt);
  }
}
void solve() {
  int sum = d + 1;
  for (int i = d - 1, coff = 1; i > 0; i -= 2, coff *= (k - 1)) {
    sum += i * (k - 2) * coff;
    if (sum >= n) break;
  }
  if (sum < n || n < d + 1) {
    puts("NO");
    return;
  }
  puts("YES");
  for (int i = 0; i < d; i++) printf("%d %d\n", i + 1, i + 2);
  int cnt = d + 1;
  for (int i = 2; i <= d && cnt < n; i++) {
    output(i, 0, min(i - 1, d + 1 - i), cnt);
  }
}
int main() {
  cin >> n >> d >> k;
  solve();
  return 0;
}
