import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.AbstractCollection;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int d = in.nextInt();
            int k = in.nextInt();

            boolean[] used = new boolean[n + 1];
            Arrays.fill(used, false);
            int[] degree = new int[n + 1];
            Arrays.fill(degree, 0);

            List<Pair> edges = new ArrayList<>();
            if (d + 1 > n) {
                out.print("NO");
                return;
            }

            PriorityQueue<Pair> p = new PriorityQueue<>((Pair x, Pair y) -> y.second - x.second);
            for (int i = 1; i <= d; i++) {
                int v = i + 1;
                used[i] = true;
                used[v] = true;
                degree[i]++;
                degree[v]++;
                p.add(new Pair(i, Math.min(i - 1, (d + 1 - i))));
                edges.add(new Pair(i, v));
            }
            p.add(new Pair(d + 1, 0));
            for (int i = 1; i <= n; i++) {
                if (!used[i]) {
                    if (p.isEmpty()) {
                        out.print("NO");
                        return;
                    }

                    while (!p.isEmpty()) {
                        Pair x = p.poll();
                        int canAdd = Math.min(k - degree[x.first], x.second);
                        if (canAdd == 0) continue;
                        used[i] = true;
                        degree[x.first]++;
                        degree[i]++;
                        p.add(new Pair(x.first, x.second));
                        p.add(new Pair(i, x.second - 1));
                        edges.add(new Pair(x.first, i));
                        break;
                    }
                }
            }

            out.println("YES");
            assert (edges.size() == n - 1);
            for (Pair x : edges) {
                out.println(x.first + " " + x.second);
            }

        }

        private class Pair {
            int first;
            int second;

            public Pair(int first, int second) {
                this.first = first;
                this.second = second;
            }

        }

    }

    static class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;

        public FastScanner(InputStream inputStream) {
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreElements()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

