#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 4 * 1e5 + 100;
vector<int> edge[maxn];
int st[maxn];
int cnt[maxn];
int tot, n, d, k;
void bfs(int u) {
  queue<int> que;
  for (int i = u; i <= d; i++) que.push(i);
  while (!que.empty()) {
    int t = que.front();
    que.pop();
    if (st[t] >= d) continue;
    int c = cnt[t];
    for (int i = c + 1; i <= k; i++) {
      if (tot == n) break;
      edge[t].push_back(++tot);
      que.push(tot);
      st[tot] = max(st[tot], st[t] + 1);
      cnt[t]++;
      cnt[tot]++;
    }
    if (tot == n) break;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  while (cin >> n >> d >> k) {
    if (k == 1 && n == 2 && d == 1) {
      cout << "YES" << endl;
      cout << 1 << " " << 2 << endl;
      continue;
    } else if (k == 1) {
      {
        cout << "NO" << endl;
        continue;
      }
    }
    for (int i = 0; i <= n; i++) edge[i].clear();
    int flag = 0;
    if (n <= d) {
      cout << "NO" << endl;
      continue;
    }
    memset(st, -1, sizeof(st));
    memset(cnt, 0, sizeof(cnt));
    for (int i = 1; i <= d; i++) {
      edge[i].push_back(i + 1);
      cnt[i]++;
      cnt[i + 1]++;
      st[i] = max(i - 1, d - i + 1);
    }
    st[d + 1] = 0;
    tot = d + 1;
    bfs(2);
    for (int i = 1; i <= n; i++)
      if (st[i] == -1) {
        flag = 1;
        break;
      }
    if (flag)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int i = 1; i <= n; i++) {
        if (edge[i].size()) {
          for (int j = 0; j < edge[i].size(); j++) {
            int t = edge[i][j];
            cout << i << " " << t << endl;
          }
        }
      }
    }
  }
}
