import java.util.*;

public class CF1003E {

    private static List<int[]> links = new ArrayList<>();

    private static class Node {
        public int id;
        public int distance;
        public int degree;

        public Node(int id, int distance, int degree) {
            this.id = id;
            this.distance = distance;
            this.degree = degree;
        }

    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int d = scanner.nextInt();
        int k = scanner.nextInt();

        Stack<Node> nodes = new Stack<>();
        if (n == 2 && d == 1 && k == 1) {
            System.out.println("YES");
            System.out.println("1 2");
            return;
        }
        if (n < d + 1 || k < 2) {
            System.out.println("NO");
            return;
        }

        for (int i = 2; i < d + 1; i++) {
            links.add(new int[]{i - 1, i + 1});
            Node node = new Node(i + 1, i / 2, 2);
            nodes.add(node);
        }
        links.add(new int[]{(d + 1), d});

        for (int i = d + 2; i <= n; i++) {
            while (!nodes.isEmpty() && nodes.peek().degree >= k) {
                nodes.pop();
            }
            if (nodes.isEmpty()) {
                System.out.println("NO");
                return;
            }

            Node parent = nodes.pop();
            Node child = new Node(i, parent.distance - 1, 1);
            links.add(new int[]{parent.id, child.id});
            parent.degree++;
            if (child.distance > 0) {
                nodes.push(child);
            }
            if (parent.degree < k) {
                nodes.push(parent);
            }
        }

        StringBuilder sb = new StringBuilder();
        sb.append("YES\n");
        for (int[] e : links) {
            sb.append(e[0]).append(' ').append(e[1]).append('\n');
        }
        System.out.println(sb.toString());
    }

}