#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
const int INF = 0x3f3f3f3f;
int n, d, k;
int cnt;
vector<int> s[400005];
void dfs(int x, int c) {
  if (c == 0) return;
  while (s[x].size() < k && cnt <= n) {
    s[x].push_back(cnt);
    s[cnt].push_back(x);
    cnt++;
    dfs(cnt - 1, c - 1);
  }
}
int main() {
  cin >> n >> d >> k;
  if (d >= n) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= d; i++) {
    s[i].push_back(i + 1);
    s[i + 1].push_back(i);
  }
  cnt = d + 2;
  for (int i = 2; i <= d; i++) {
    dfs(i, min(i - 1, d - i + 1));
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i].size() > k) {
      flag = 1;
      break;
    }
  }
  int vis[400005];
  memset(vis, 0, sizeof(vis));
  if (!flag && cnt > n) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < s[i].size(); j++) {
        if (!vis[i] || !vis[s[i][j]]) {
          cout << i << " " << s[i][j] << endl;
          vis[i] = vis[s[i][j]] = 1;
        }
      }
    }
  } else {
    cout << "NO" << endl;
  }
}
