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

public class Main
{
	static MyList[] graph;

	public static void main(String[] args)
	{
		FastReader reader = new FastReader();
		PrintWriter writer = new PrintWriter(System.out);

		int n = reader.nextInt();
		int d = reader.nextInt();
		int k = reader.nextInt();
		boolean possible = true;

		graph = new MyList[n];
		for (int i=0; i<n; i++)
			graph[i] = new MyList();



		if (d+1 > n)
			possible = false;
		else
		{
			for (int i=0; i<d; i++)
				graph[i].list.add(i+1);

			int counter = d+1;

			PriorityQueue<Pair> heap = new PriorityQueue<Pair>();
			for (int i=1; i<d; i++)
				heap.offer(new Pair(i, Math.max(i, d-i), 2));

			while (counter<n && !heap.isEmpty())
			{
				Pair temp = heap.poll();

				if (temp.dist<d && temp.degr<k)
				{
					graph[temp.index].list.add(counter);
					heap.offer(new Pair(counter, temp.dist+1, 1));
					
					temp.degr += 1;
					heap.offer(temp);

					counter++;
				}
			}

			if (counter < n)
				possible = false;
		}

		if (possible)
		{
			writer.println("YES");
			for (int i=0; i<n; i++)
			{
				for (int j : graph[i].list)
					writer.println((i+1) + " " + (j+1));
			}
		}
		else
			writer.println("NO");

		writer.close();
	}



	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			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 nextInt()
		{
			return Integer.parseInt(next());
		}

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

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

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}
}

class MyList
{
	ArrayList<Integer> list = new ArrayList<>();
}

class Pair implements Comparable<Pair>
{
	int index;
	int dist;
	int degr;

	public Pair (int ind, int di, int de)
	{
		index = ind;
		dist = di;
		degr = de;
	}

	public int compareTo (Pair temp)
	{
		return Integer.compare(this.dist, temp.dist);
	}
}