import java.util.ArrayList;
import java.util.BitSet;
import java.util.LinkedList;
import java.util.Scanner;

public class CF1003E {
	static int cur;
	static ArrayList<Integer> x;
	static ArrayList<Integer> y;
	static int n;
	static int d;
	static int k;
	static int maxDepth = 0;
	
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		d = sc.nextInt();
		k = sc.nextInt();
		x = new ArrayList<>();
		y = new ArrayList<>();
		cur = 1;
		if(cur<n) {
			x.add(1);
			y.add(cur+1);
			dfs(cur++, 1);
		}
		if(cur<n) System.out.println("NO");
		else {
			System.out.println("YES");
			for(int i=0; i<x.size(); i++) System.out.println(x.get(i)+" "+y.get(i));
		}
	}
	
	static void dfs(int src, int depth) {
		maxDepth = Math.max(maxDepth, depth);
		for(int i=0; cur<n && i<k-1; i++) { 
			depth = Math.max(depth, maxDepth-depth);
			if(depth+1<=d) {
				x.add(src+1);
				y.add(cur+1);
				dfs(cur++, depth+1);
			}
		}
	}
}
