#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double E = exp(1.0);
const double eps = 1e-30;
const double INFD = 1e20;
const long long INFLL = 0x3f3f3f3f3f3f3f3fll;
const int INF = 0x3f3f3f3f;
const int maxn = (int)5e3 + 10;
const int MAXN = (int)1e5 + 10;
const int MOD = (int)1e9 + 7;
int n, d, k;
int node;
vector<pair<int, int> > edge;
void dfs(int x, int y, int cnt) {
  if (n == 0 || cnt == 0) return;
  for (int i = 1; i <= y && n; ++i) {
    edge.push_back(make_pair(x, node));
    int temp = node;
    node++;
    --n;
    dfs(temp, k - 1, cnt - 1);
  }
}
void solve() {
  if ((d > 1 && k < 2) || d >= n) {
    puts("NO");
    return;
  }
  for (int i = 1; i <= d; ++i) {
    edge.push_back(make_pair(i, i + 1));
  }
  node = d + 2;
  n -= (d + 1);
  for (int i = 2; i <= d && n; ++i) {
    for (int j = 1; j <= (k - 2) && n; ++j) {
      int m = max(i - 1, d + 1 - i);
      dfs(i, 1, d - m);
    }
  }
  if (n) {
    puts("NO");
    return;
  }
  puts("YES");
  int len = edge.size();
  for (int i = 0; i < len; ++i) {
    printf("%d %d\n", edge[i].first, edge[i].second);
  }
}
void RUN() {
  while (~scanf("%d %d %d", &n, &d, &k)) {
    edge.clear();
    solve();
  }
}
int main() {
  RUN();
  return 0;
}
