import java.io.*; 
import java.math.*;
import java.util.*;
import java.awt.Point;
 
public class Main {
	static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	//static final long MOD = 1000000007L;
	//static final int INF = 1000000007;
	
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int N = sc.ni();
		int D = sc.ni();
		int K = sc.ni();
		if (D==1) {
			if (N==1) {
				pw.println("NO");
			} else if (N==2) {
				pw.println("YES");
				pw.println("1 2");
			} else {
				pw.println("NO");
			}
		} else if (N <= D) {
			pw.println("NO");
		} else if (K == 1) {
			pw.println("NO");
		} else {
			int[][] edges = new int[N-1][2];
			
			for (int i = 0; i < D; i++) {
				edges[i] = new int[]{i+1,i+2};
			}
			int index = D;
			int node = D+2;
			PriorityQueue<int[]> pq = new PriorityQueue<int[]>(new Comparator<int[]>(){
				public int compare(int[] a, int[] b) {
					return a[1] - b[1];
				}
			}); //pq is node and its depth
			loop:
			for (int i = 2; i <= D; i++) {
				int d = Math.max(i-1,D+1-i); //depth of the node
				for (int j = 0; j < K-2; j++) {
					if (index == N-1) break loop;
					edges[index] = new int[]{i,node};
					pq.add(new int[]{node,d+1});
					index++;
					node++;
				}
			}
			poll:
			while (index < N-1 && !pq.isEmpty()) {
				int[] point = pq.poll();
				if (point[1]==D) continue;
				for (int j = 0; j < K-1; j++) {
					if (index == N-1) break poll;
					edges[index] = new int[]{point[0],node};
					pq.add(new int[]{node,point[1]+1});
					index++;
					node++;
				}
			}
			if (edges[N-2][0]==0) {
				pw.println("NO");
			} else {
				pw.println("YES");
				for (int[] edge: edges)
					pw.println(edge[0] + " " + edge[1]);
			}
		}
		pw.close();
 	}
	
	//Fast exponentiation (x^y mod p)
	public static long power(long x, long y, long p) { 
		// Initialize result
		long res = 1;

		// Update x if it is more   
		// than or equal to p 
		x = x % p;  

		while (y > 0) { 
			// If y is odd, multiply x 
			// with result 
			if((y & 1)==1) 
				res = (res * x) % p; 

			// y must be even now 
			// y = y / 2 
			y = y >> 1;  
			x = (x * x) % p;  
		} 
		return res; 
	}
	
    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr2[0]-arr1[0]; //descending order
	          }
		});
		return array;
	}
    
    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
			  //Descending order
        	  public int compare(long[] arr1, long[] arr2) {
				  if (arr2[0] < arr1[0])
					  return -1;
				  if (arr2[0] > arr1[0])
					  return 1;
				  return 0;
	          }
		});
		return array;
	}
    
    static class FastScanner { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastScanner() { 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int ni() { 
            return Integer.parseInt(next()); 
        } 
  
        long nl() { 
            return Long.parseLong(next()); 
        } 
  
        double nd() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try { 
                str = br.readLine(); 
            } catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str; 
        }
    }
}