import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author llamaoo7
 */
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);
        ETreeConstructing solver = new ETreeConstructing();
        solver.solve(1, in, out);
        out.close();
    }

    static class ETreeConstructing {
        int curNode = -1;
        int n;
        int[] g;
        int maxDiam;
        int maxDeg;

        void build(int p, int d, int deg) {
            if (curNode >= n - 1) return;
            int thisNode = ++curNode;
            g[curNode] = p;
            if (d == maxDiam / 2) return;
            for (int i = 0; i < deg; i++)
                build(thisNode, d + 1, deg == maxDeg ? deg - 1 : deg);
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            n = in.nextInt();
            if (n == 1) {
                out.println("YES");
                return;
            }
            maxDiam = in.nextInt();
            maxDeg = in.nextInt();
            g = new int[n];
            if (maxDiam % 2 == 1) {
                build(-1, 0, maxDeg - 1);
                if (curNode < n - 1) {
                    build(0, 0, maxDeg - 1);
                }
            } else {
                build(-1, 0, maxDeg);
            }
            if (curNode >= n - 1) {
                out.println("YES");
                for (int i = 0; i < n; i++) if (g[i] != -1) out.println((i + 1) + " " + (g[i] + 1));
                return;
            }
            out.println("NO");
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}

