import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

@SuppressWarnings("unused")
public class Solution{
	
	static ArrayList<Integer>[] g;
	
	@SuppressWarnings("unchecked")
	public static void main(String[] args) throws IOException {
		FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    	
    	int tt = 1;
    	outer:
    	while(tt-->0) {
    		
    		int n = fs.nextInt(), d = fs.nextInt(), k = fs.nextInt();
    		
    		if(d>n-1) {
    			out.println("NO"); continue outer; 
    		}
    		
    		ArrayList<int[]> ans = new ArrayList<>();
    		int[] deg = new int[n+1];
    		
    		for(int i=1;i<=d;i++) {
    			deg[i]++; deg[i+1]++;
    			if(deg[i]>k || deg[i+1]>k) {
    				out.println("NO"); continue outer;
    			}
    			ans.add(new int[] {i, i+1});
    		}
    		
    		//returns the vertex with the minimum eccentricity
    		PriorityQueue<int[]> pq = new PriorityQueue<int[]>((v1,v2) -> v1[1]-v2[1]);
    		
    		for(int i=1;i<=d+1;i++) {
    			pq.add(new int[] {i, Math.max(i-1, d+1-i)});
    		}
    		
    		for(int i=d+2;i<=n;i++) {
    			while(!pq.isEmpty() && deg[pq.peek()[0]]==k) pq.poll();
    			if(pq.isEmpty() || pq.peek()[1]==d) {
    				out.println("NO"); continue outer;
    			}
    			int u = pq.peek()[0];
    			deg[u]++; deg[i]++;
    			ans.add(new int[] {i, u});
    			pq.add(new int[] {i, pq.peek()[1]+1});
    		}
    		
    		out.println("YES");
    		for(int[] ar: ans) {
    			out.println(ar[0]+" "+ar[1]);
    		}
    		
    	}
    	
    	out.close();
    }
	
	
	
	
    static final Random random=new Random();
    
    static <T> void shuffle(T[] arr) {
    	int n = arr.length;
    	for(int i=0;i<n;i++	) {
    		int k = random.nextInt(n);
    		T temp = arr[k]; arr[k] = arr[i]; arr[i] = temp;
    	}
    }
    
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
    
    static void ruffleSort(long[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); long temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    static void reverse(int[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		int temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    static void reverse(long[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		long temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    
    static <T> void reverse(T[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++) {
    		T temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }


   	
}
