import java.util.*;

public class codeforces {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = sc.nextInt();
        int k = sc.nextInt();

        int[] deg=new int[n+1];
        int[] depth=new int[n+1];

        StringBuilder ans=new StringBuilder("");
        Queue<Integer > q=new LinkedList<>();
        for(int i=1;i<d;i++){
            deg[i]=(i==1 || i==d ? 1 :2);
            depth[i]=i;
            if(i==d) continue;
            q.add(i);
            ans.append(i+" "+(i+1)+"\n");
        }

        int v=d+1;
        while(q.size()!=0){
            int u=q.poll();

            for(int i=deg[u]+1;v<=n && i<=k;i++){
                depth[v]=depth[u]+1;

                if(depth[v]!=d)
                    q.add(v);

                deg[u]++;
                deg[v]=1;
                ans.append(u+" "+v+" "+"\n");
                v++;
            }
            if(v>=n)
                break;
        }

        if(v<n)
            System.out.println("NO");
        else
            System.out.println("YES"+"\n"+ans);




    }
}