import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.util.Objects;
import java.util.AbstractCollection;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Comparator;
import java.io.InputStream;

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

    static class TaskE {
        public void solve(int testNumber, FastReader in, OutputWriter out) {
            Debug debug = new Debug();
            int n = in.nextInt();
            int d = in.nextInt();
            int K = in.nextInt();
            if (d > n - 1 || (n > 1 && K == 1)) {
                out.printLine("NO");
                return;
            }
            int[] deg = new int[n + 100];
            int[] value = new int[n + 100];
            HashSet<TaskE.Pair> set = new HashSet<>();
            PriorityQueue<Integer> priorityQueue = new PriorityQueue<>(new Comparator<Integer>() {

                public int compare(Integer o1, Integer o2) {
                    return deg[o2] - deg[o1];
                }
            });
            for (int i = 0; i < n; ++i) priorityQueue.add(i);

            int ptr = d + 1;
            for (int i = 0; i <= d; ++i) {
                value[i] = Math.min(i, d - i);
            }
            for (int i = 0; i + 1 <= d; ++i) {
                set.add(new TaskE.Pair(i, i + 1));
                deg[i] += 1;
                deg[i + 1] += 1;
                priorityQueue.add(i);
                priorityQueue.add(i + 1);
            }
            outer:
            while (!priorityQueue.isEmpty()) {
                int cur = priorityQueue.poll();
                if (ptr >= n) break;
                if (deg[cur] == K || value[cur] == 0) continue;
                int rem = K - deg[cur];
                for (int i = 0; i < rem; ++i) {
                    set.add(new TaskE.Pair(cur, ptr));
                    ++deg[cur];
                    ++deg[ptr];
                    value[ptr] = value[cur] - 1;
                    priorityQueue.add(cur);
                    priorityQueue.add(ptr);
                    ++ptr;
                    if (set.size() == n - 1) break outer;
                }
                if (set.size() == n - 1) break outer;
            }
            boolean check = true;
            for (int i = 0; i < n; ++i) check &= deg[i] > 0;
            if (!check) {
                out.printLine("NO");
            } else {
                out.printLine("YES");
                for (TaskE.Pair pair : set) out.printLine((pair.from + 1) + " " + (pair.to + 1));
            }
        }

        static class Pair implements Comparable<TaskE.Pair> {
            int from;
            int to;

            public Pair(int from, int to) {
                this.from = from;
                this.to = to;
            }


            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                TaskE.Pair pair = (TaskE.Pair) o;
                return from == pair.from &&
                        to == pair.to || from == pair.to && to == pair.from;
            }


            public String toString() {
                return "Pair{" +
                        "from=" + from +
                        ", to=" + to +
                        '}';
            }


            public int hashCode() {

                return Objects.hash(from, to);
            }


            public int compareTo(TaskE.Pair o) {
                if (from != o.from)
                    return from - o.from;
                return to - o.to;
            }

        }

    }

    static class Debug {
        PrintWriter out;
        boolean oj;
        boolean system;
        long timeBegin;
        Runtime runtime;

        public Debug(PrintWriter out) {
            oj = System.getProperty("ONLINE_JUDGE") != null;
            this.out = out;
            this.timeBegin = System.currentTimeMillis();
            this.runtime = Runtime.getRuntime();
        }

        public Debug() {
            system = true;
            oj = System.getProperty("ONLINE_JUDGE") != null;
            OutputStream outputStream = System.out;
            this.out = new PrintWriter(outputStream);
            this.timeBegin = System.currentTimeMillis();
            this.runtime = Runtime.getRuntime();
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}

