import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main
{  
    static MyScanner scan;
    static PrintWriter pw;
    static int n,d,k;
    static int added[],max_level[];
    static ArrayList<Integer> adj[];
    static int curr;
    static boolean vis[];
    public static void main(String[] args) {
        new Thread(null,null,"_",100000000)
        {
           @Override
           public void run()
           {
               try
               {
                   solve();
               }
               catch(Exception e)
               {  
                   e.printStackTrace();
                   System.exit(1);
               }
           }
        }.start();
    }
    static void solve() throws IOException
    {
        scan = new MyScanner();
        pw = new PrintWriter(System.out,true);
        StringBuilder sb = new StringBuilder();
        n = ni();
        d = ni();
        k = ni();
        if(d>n-1)
        {
            pl("NO");
            System.exit(0);
        }
        if(k==1)
        {
            if(n==1)
                pl("YES");
            else if(n==2)
                pl("YES\n1 2");
            else pl("NO");
            System.exit(0);
        }
        else
        {
            adj = new ArrayList[n+1];
            for(int i=1;i<=n;++i)
                adj[i] = new ArrayList();
            added = new int[n+1];
            max_level = new int[n+1];
            for(int i=1;i<=d+1;++i)
            {
                if(i>1)
                {
                    adj[i].add(i-1);
                    added[i]++;
                }
                if(i<=d)
                {
                    adj[i].add(i+1);
                    added[i]++;
                }
                max_level[i] = min(i-1,d+1-i);
            }
            curr = d+2;
            vis = new boolean[n+1];
            dfs(1);
            if(curr==n+1)
            {
                pl("YES");
                for(int i=1;i<=n;++i)
                {
                    for(int e:adj[i])
                        if(e>i)
                            pl(i+" "+e);
                }
            }
            else
            {
                pl("NO");
            }
        }
        pw.flush();
        pw.close();
    }
    static void dfs(int x)
    {  
        //pl("x : "+x);
        vis[x] = true;
        if(max_level[x]>0) {
        while(curr<=n && added[x]<k)
        {
            adj[x].add(curr);
            adj[curr].add(x);
            added[x]++;
            max_level[curr] = max_level[x]-1;
            ++curr;
        }  
        }
        for(int e:adj[x])
            if(!vis[e])
                dfs(e);
    }
    static int ni() throws IOException
    {
        return scan.nextInt();
    }
    static long nl() throws IOException
    {
        return scan.nextLong();
    }
    static double nd() throws IOException
    {
        return scan.nextDouble();
    }
    static String ne() throws IOException
    {
        return scan.next();
    }
    static String nel() throws IOException
    {
        return scan.nextLine();
    }
    static void pl()
    {
        pw.println();
    }
    static void p(Object o)
    {
        pw.print(o+" ");
    }
    static void pl(Object o)
    {
        pw.println(o);
    }
    static void psb(StringBuilder sb)
    {
        pw.print(sb);
    }
    static class MyScanner
    {
        BufferedReader br;
        StringTokenizer st;
        MyScanner()
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String nextLine()throws IOException
        {
            return br.readLine();
        }
        String next() throws IOException
        {
            if(st==null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }
        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
}