                            /* Rajkin Hossain */
import java.io.*;
import java.util.*;

public class D {

    //static FastInput k = new FastInput("/home/rajkin/Desktop/input.txt");
    static FastInput k = new FastInput(System.in);
    static FastOutput z = new FastOutput();
    static int nodes, diameter, degree;
    static ArrayList<Pair> ans;
    static int nei;
    static ArrayList<Integer> specialNodes;
    
    static void printAns() {
    	z.println("YES");
    	for(int i = 1; i<=diameter - 1; i++) {
    		ans.add(new Pair(i, i+1));
    	}
    	
    	int size = ans.size();
    	
    	for(int i = 0; i<size; i++) {
    		Pair p = ans.get(i);
    		z.println(p.u+" "+p.v);
    	}
    }
    
    static void doForSpecialNodes() {
    	boolean ok = false;
    	for(int i = 0; i<specialNodes.size(); i++) {
    		int node = specialNodes.get(i);
    		for(int d = 1; d<degree; d++) {
    			ans.add(new Pair(node, nei));
    			if(nei == nodes) {
    				ok = true;
    				printAns();
    				break;
    			}
    			nei++;
    		}
    	}
    	
    	if(ok == false) {
    		z.println("NO");
    	}
    }
       
    static void startAlgorithm() {
    	boolean done = false;
    	if(nodes > diameter) {
    		for(int i = 1; i<=diameter - 1; i++) {
    			int newDegree = i == 1 ? degree - 1 : degree - 2;
    			for(int d = 1; d<=newDegree; d++) {
    				ans.add(new Pair(i, nei));
    				if(i == 2) specialNodes.add(nei);
    				if(nei == nodes) {
    					printAns();
    					done = true;
    					break;
    				}
    				
    				nei++;
    			}
    			
    			if(done) {
    				break;
    			}
    		}
    		
    		if(done == false) {
    			doForSpecialNodes();
    		}
    	}
    	else {
    		z.println("NO");
    	}
    }
	
	static void getInputsAndInitializes() {
		nodes = k.nextInt();
		diameter = k.nextInt();
		degree = k.nextInt();
		
		nei = diameter + 1;
		specialNodes = new ArrayList<Integer>();
		
		ans = new ArrayList<Pair>();
    }
    
	public static void main(String [] args) throws FileNotFoundException {        
		
		while(k.hasNext()) {
        	getInputsAndInitializes();
        	startAlgorithm();
        }
        z.flush();
        System.exit(0);
	}
	
	
	/* MARK: Pair implementation */
	
	public static class Pair {
		int u, v;
		public Pair(int u, int v) {
			this.u = u;
			this.v = v;
		}
	}
	
	
    /* MARK: FastInput and FastOutput implementation */
	 
    public static class FastInput {
        BufferedReader reader;
        StringTokenizer tokenizer;
 
        public FastInput(InputStream stream){
            reader = new BufferedReader(new InputStreamReader(stream));
        }
        
	    public FastInput(String path){
	        try {
	        	reader = new BufferedReader(new FileReader(path));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	        tokenizer = null;
	    }
 
        public String next() {
            return nextToken();
        }
        
        public String nextLine() {
            try {
				return reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            
            return null;
        }
 
        public boolean hasNext(){
            try {
                return reader.ready();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return false;
        }
 
        public String nextToken() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                String line = null;
                try {
                    line = reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (line == null) {
                    return null;
                }
                tokenizer = new StringTokenizer(line);
            }
            return tokenizer.nextToken();
        }
 
        public Integer nextInt() {
            return Integer.parseInt(nextToken());
        }
       
        public Long nextLong() {
            return Long.valueOf(nextToken());
        }
    	
    	public void inputIntegerList(ArrayList<Integer> list, int size) {
    		for(int i = 0; i<size; i++) {
    			list.add(nextInt());
    		}
    	}
    	
    	public void inputLongList(ArrayList<Long> list, int size) {
    		for(int i = 0; i<size; i++) {
    			list.add(nextLong());
    		}
    	}
    	
    	public void inputWordList(ArrayList<String> list, int size) {
    		for(int i = 0; i<size; i++) {
    			list.add(next());
    		}
    	}
    	
    	public void inputLineList(ArrayList<String> list, int size) {
    		for(int i = 0; i<size; i++) {
    			list.add(nextLine());
    		}
    	}
    	
    	public void inputIntegerArray(int [] array, int size) {
    		for(int i = 0; i<size; i++) {
    			array[i] = nextInt();
    		}
    	}

    	public void inputLongArray(long [] array, int size) {
    		for(int i = 0; i<size; i++) {
    			array[i] = nextLong();
    		}
    	}
    	
    	public void inputWordArray(String [] array, int size) {
    		for(int i = 0; i<size; i++) {
    			array[i] = next();
    		}
    	}
    	
    	public void inputLineArray(String [] array, int size) {
    		for(int i = 0; i<size; i++) {
    			array[i] = nextLine();
    		}
    	}
    }
 
    public static class FastOutput extends PrintWriter {
    	public FastOutput() { 
            super(new BufferedOutputStream(System.out)); 
    	}
    	
    	public void printSideBySideSet(Set<Object> set, int size) {
    		boolean isFirstElementPrinted = false;
    		for(Object element : set) {
    			if(!isFirstElementPrinted) {
    				print(element);
    				isFirstElementPrinted = true;
    				
    				return;
    			}
    			print(" "+element);
    		}
    		println();
    	}
    	
    	public void printLineByLineSet(Set<Object> set, int size) {
    		for(Object element : set) {
    			println(element);
    		}
    	}
    	
    	public void printSideBySideList(ArrayList<Object> list, int size) {
    		print(list.get(0));
    		for(int i = 1; i<size; i++) {
    			print(" "+list.get(i));
    		}
    		println();
    	}
    	
    	public void printLineByLineList(ArrayList<Object> list, int size) {
    		for(int i = 0; i<size; i++) {
    			println(list.get(i));
    		}
    	}
    	
    	public void printSideBySideArray(Object [] array, int size) {
    		print(array[0]);
    		for(int i = 1; i<size; i++) {
    			print(" "+array[i]);
    		}
    		println();
    	}
    	
    	public void printLineByLineArray(Object [] array, int size) {
    		for(int i = 0; i<size; i++) {
    			println(array[i]);
    		}
    	}
    }
}