//package contest_488;
import java.io.*;
import java.util.*;
import javafx.util.Pair;
public class q3
{
public static void main(String[] args)
{
	InputReader in =new InputReader(System.in);
	OutputWriter out=new OutputWriter(System.out);
	Scanner sc=new Scanner(System.in);
	HashMap<Long,Integer> h=new HashMap();
	HashMap<Integer,Long> map=new HashMap();
 	int n=in.readInt();
 	Vector<Integer>[] v=new Vector[n+1];
 	Vector<Pair<Integer,Integer>> v1=new Vector();
 	int d=in.readInt();
 	int k=in.readInt();
 	int[] deg=new int[n+1];
 	for(int i=1;i<=n;i++)
 		deg[i]=0;
 	for(int i=1;i<=n;i++)
 		v[i]=new Vector();
 	if(d>=n)
 	{
 		System.out.println("NO");
 		System.exit(0);
 	}
 	if(d>=2&&k<2)
 	{
 		System.out.println("NO");
 		System.exit(0);
 	}
 	if(d==2&&n>3)
 	{
 		System.out.println("NO");
 		System.exit(0);
 	}
 	if(d==2&&n==2)
 	{
 		System.out.print("YES"+"\n");
 		System.out.print(1+" "+2);
 		System.exit(0);
 	}
 	if(d==2&&n==3)
 	{
 		System.out.print("YES"+"\n");
 		System.out.println(1+" "+2);
 		out.print(1+" "+3);
 		System.exit(0);
 	}
   for(int i=1;i<d;i++)
   {
	   v[i].add(i+1);
	   v1.add(new Pair(i,i+1));
	   deg[i]++;
	   deg[i+1]++;
   }
	int j=1;
	int i=d+1;
	while(j<d&&i<=n)
	{
		
		if(deg[j]==k)
		{
			j=j+1;
		}
		
		else
		{
		v[j].add(i);
		v1.addElement(new Pair(j,i));
		deg[j]++;
		deg[i]++;
		i++;
		}
	}
	j=d-2;
	while(j>1&&i<=n)
	{
	Iterator<Integer> itr=v[j].iterator();
	while(itr.hasNext()&&i<=n)
	{
		int num=itr.next();
		while(deg[num]<k&&i<=n)
		{
		v[num].add(i);
		v1.addElement(new Pair(num,i));
		deg[num]++;
		deg[i]++;
		i++;
		}
	}
	j--;
	}
	if(i<=n)
		out.print("NO");
	else
	{
		out.print("YES"+"\n");
		Iterator<Pair<Integer,Integer>> itre=v1.iterator();
		while(itre.hasNext())
		{
			Pair<Integer,Integer> p=itre.next();
			int x=p.getKey();
			int y=p.getValue();
			out.print(x+" "+y+"\n");
		}
	}
	out.flush();
	out.close();
	
}
static int floorSearch(int arr[], int low, 
        int high, int x)
{
// If low and high cross each other
if (low > high)
return -1;

// If last element is smaller than x
if (x >= arr[high])
return high;

// Find the middle point
int mid = (low+high)/2;

// If middle point is floor.
if (arr[mid] == x)
return mid;

// If x lies between mid-1 and mid
if (mid > 0 && arr[mid-1] <= x && x <
                arr[mid])
return mid-1;

// If x is smaller than mid, floor
// must be in left half.
if (x < arr[mid])
return floorSearch(arr, low, 
           mid - 1, x);

// If mid-1 is not floor and x is
// greater than arr[mid],
return floorSearch(arr, mid + 1, high,
                     x);
}
}
class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private 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 String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }

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

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();
    }

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

}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.readInt();
        return array;
    }

}