import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
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;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        ArrayList<Integer>[] edge;
        int n;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            n = in.readInt();
            int d = in.readInt();
            int k = in.readInt();
            if (d >= n) {
                out.println("NO");
                return;
            }
            edge = new ArrayList[n + 1];
            for (int i = 0; i <= n; i++) {
                edge[i] = new ArrayList();
            }
            for (int i = 2; i <= d + 1; i++) {
                int a = i, b = i - 1;
                edge[a].add(b);
                edge[b].add(a);
            }

            for (int i = 2, x = d + 2; i <= d; i++) {
                for (int j = 2; j < k && x <= n; j++) {
                    int a = i;
                    int b = x;
                    edge[a].add(b);
                    edge[b].add(a);
                    x++;
                    x = add(b, i - 2, x, k);
                }
            }

            for (int i = 1; i <= n; i++) {
                if (edge[i].size() == 0 || edge[i].size() > k) {
                    out.println("NO");
                    return;
                }
            }

            out.println("YES");
            for (int i = 1; i <= n; i++) {
                for (int j : edge[i]) {
                    if (j > i) {
                        out.println(i + " " + j);
                    }
                }
            }

        }

        int add(int s, int cnt, int b, int k) {
            if (cnt == 0) return b;
            for (int i = 1; i < k && b <= n; i++) {
                int a = s;
                edge[a].add(b);
                edge[b].add(a);
                b++;
                b = add(b, cnt - 1, b, k);
            }
            return b;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

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

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

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

