import java.io.*;
import java.util.*;

public class E {
	public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		int n = sc.nextInt();
		int d = sc.nextInt();
		int k = sc.nextInt();

		if (n == 1) {
			System.out.println("NO");
			return;
		}
		if (n == 2)
			if (d == 1) {
				System.out.println("YES");
				System.out.println("1 2");
				return;
			} else {
				System.out.println("NO");
				return;
			}
		if (k == 1) {
			System.out.println("NO");
			return;
		}
		if (k == 2) {
			if (n != d + 1) {
				System.out.println("NO");
				return;
			} else {
				pw.println("YES");
				for (int i = 1; i < n; i++)
					pw.println(i + " " + (i + 1));
				pw.flush();
				return;
			}
		}
		k--;
		boolean sol = false;
		for (int i = 0; i < n; i++) {
			int rem = n - i;
			if (i + solve(rem, k) == d) {
				sol = true;
				pw.println("YES");
				boolean f = true;
				ArrayList<Integer> arr = new ArrayList<>();
				arr.add(1);
				int x = 2;
				ArrayList<Integer> lst = new ArrayList<>();
				out: while (true) {
					ArrayList<Integer> tmp = new ArrayList<>();
					if (f) {
						for (int j = 0; j < k + 1; j++) {
							tmp.add(x);
							pw.println((x) + " 1");
							x++;
							if (x > rem)
								break out;
						}
						f = false;
					} else {
						for (int ii = 0; ii < lst.size(); ii++) {
							for (int j = 0; j < k; j++) {
								tmp.add(x);
//								System.out.println("ddd");
								pw.println((x) + " " + lst.get(ii));
								x++;
								if (x > rem)
									break out;
							}
						}
					}
					lst = tmp;
				}
				for (int j = rem; j < n; j++) {
					pw.println((j) + " " + (j + 1));
				}
				break;
			}
		}
		if (!sol)
			pw.println("NO");
		pw.flush();
		pw.close();
	}

	static int solve(int x, int d) {
		long bs = 1;
		long sum = 0;
		int ret = 0;
		boolean f = true;
		while (sum + bs <= x) {
			sum += bs;
			if (f)
				bs *= (d + 1);
			else
				bs *= d;
			f = false;
			ret++;
		}
		ret--;
		ret *= 2;
		if (x - sum == 0)
			return ret;
		d++;
		if (x - sum > bs / d)
			ret += 2;
		else
			ret++;
		return ret;
	}

	static void shuffle(int[] array) {
		int index;
		Random random = new Random();
		for (int i = array.length - 1; i > 0; i--) {
			index = random.nextInt(i + 1);
			if (index != i) {
				array[index] ^= array[i];
				array[i] ^= array[index];
				array[index] ^= array[i];
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}