import java.util.Scanner;

public class Main {



    static int n;
    static int d;
    static int k;

    static int currentPointNumber;

    static int[] pathFrom;
    static int[] pathTo;

    static int currentEdgeCount = 0;
    static int[] degree;
    static int[] edgeFromPoint;
    static int[] edgeToPoint;

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

        if (d >= n) {
            System.out.println("NO");
            System.exit(0);
        }


        pathFrom = new int[n + 10];
        pathTo = new int[n + 10];

        degree = new int[n + 10];
        edgeFromPoint = new int[n + 10];
        edgeToPoint = new int[n + 10];

        for (int i = 1; i <= d; i++) {
            if (degree[i] < k && degree[i + 1] < k)
                addPath(i, i + 1);
            else {
                System.out.println("NO");
                System.exit(0);
            }
        }
        currentPointNumber = d + 2;
        for (int i = 1; i <= d + 1; i++) {
            searchPath(i, Math.min(d + 1 - i, i - 1));
        }


        if (currentPointNumber == n + 1) {
            System.out.println("YES");
            for (int i = 1; i <= n - 1; i++) {
                System.out.println(edgeFromPoint[i] + " " + edgeToPoint[i]);
            }
        } else {
            System.out.println("NO");
        }
    }


    public static void addPath(int from, int to) {
        ++degree[from];
        ++degree[to];
        ++currentEdgeCount;
        edgeFromPoint[currentEdgeCount] = from;
        edgeToPoint[currentEdgeCount] = to;
    }


    public static void searchPath(int index, int leftDiameter) {
        if (leftDiameter > 0) {
            while (degree[index] < k && currentPointNumber <= n) {
                addPath(index, currentPointNumber);
                ++currentPointNumber;
                searchPath(currentPointNumber - 1, leftDiameter - 1);
            }
        }
    }

}
