#include <bits/stdc++.h>
using namespace std;
int n, d, k;
vector<int> g[400005];
int vis[400005];
int flag = 0;
vector<pair<int, int>> vec;
int num;
void dfs(int x, int juli) {
  if (num == n || flag) {
    flag = 1;
    return;
  }
  while (vis[x] < k) {
    if (juli >= d) return;
    vec.push_back({x, ++num});
    g[x].push_back(num);
    g[num].push_back(x);
    vis[x]++;
    vis[num]++;
    dfs(num, juli + 1);
  }
}
int main() {
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO" << endl;
    return 0;
  }
  if (n == 1) {
    cout << "YES" << endl;
    return 0;
  }
  num = d + 1;
  for (int i = 1; i <= d; i++) {
    vec.push_back({i, i + 1});
    g[i].push_back(i + 1);
    g[i + 1].push_back(i);
    vis[i]++;
    vis[i + 1]++;
    if (i + 1 == n) {
      flag = 1;
      break;
    }
  }
  for (int i = 2; i <= d; i++) {
    dfs(i, max(i - 1, d + 1 - i));
  }
  if (flag) {
    cout << "YES" << endl;
    for (auto x : vec) {
      cout << x.first << ' ' << x.second << endl;
    }
  } else {
    cout << "NO" << endl;
  }
}
