import java.util.*;

public class codeforces {

    static ArrayList<Integer>[] list;
    static ArrayList<Integer>[] list2;
    static int n,d,k;
    static int diameter=0;
    static int dfs_start=2;
    static HashSet<Integer> set=new HashSet<>();

    static void dfs(int i, int par, int level) {
        set.add(i);
        if(level > diameter) {
            diameter = level;
        }
        for(int j : list2[i]) {
            if(!set.contains(j))
                dfs(j, i, level + 1);
        }
    }

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        d = sc.nextInt();
        k = sc.nextInt();
        int v=4,temp=2;

        if(n - 1 < d) {
            System.out.println("NO");
            return;
        }

        if(k == 1) {
            if(n == 2 && d == 1) {
                System.out.println("YES");
                System.out.println("1 2");
            }
            else
                System.out.println("NO");
            return;
        }

        if(d==1 && n==1){
            System.out.println("1");
            return;
        }
        if( (n==1 && d>1) || (d==1 && n>1) || (d==2 && n>k+1)){
            System.out.println("NO");
            return;
        }
        if(d==2 && n<=k+1){
            System.out.println("YES");
            for(int i=2;i<=n;i++)
                System.out.println("1 "+i);
            return;
        }




        Queue<Integer > q=new LinkedList<>();
        list=new ArrayList[n+1];
        list2=new ArrayList[n+1];
        int[] deg=new int[n+1];
        int[] dep=new int[n+1];

        for(int i=0;i<=n;i++) {
            list[i] = new ArrayList<>();
            list2[i] = new ArrayList<>();
        }

        q.add(2);q.add(3);
        list[1].add(2);list[1].add(3);
        list2[1].add(2);list2[1].add(3);
        list2[2].add(1);list2[3].add(1);
        dep[2]=dep[3]=deg[2]=deg[3]=1;
        deg[1]=2;

        int h=(d%2==0 ? d : d-1);
        while(q.size()>0 && temp<h && v<=n){
            int u=q.poll();
            list[u].add(v);
            list2[v].add(u);
            list2[u].add(v);
            dep[v]=dep[u]+1;
            deg[u]++;
            deg[v]++;
            q.add(v);
            if(v%2==0)
            dfs_start=v;
            v++;

            temp=temp+1;
        }

        if(d%2!=0){
            int u=d-1;
            for(int i=deg[u]+1;v<=n && i<=k;i++){
                list[u].add(v);
                list2[v].add(u);
                list2[u].add(v);
                dep[v]=dep[u]+1;
                deg[u]++;
                deg[v]++;
                dfs_start=v;
                v++;
            }
        }

        if(v>n){
            print();
            return;
        }

        q=new LinkedList<>();
        q.add(1);
        while(q.size()>0){
            int u=q.poll();
            if(dep[u]*2>=d || dep[u]*2+1>=d)
                continue;
            for(int i=deg[u]+1;v<=n && i<=k;i++){
                list[u].add(v);
                list2[u].add(v);
                list2[v].add(u);
                dep[v]=dep[u]+1;
                deg[v]++;
                v++;
            }
            for(Integer t:list[u]){
                q.add(t);
            }
            if(v>n)
                break;

        }

        if(v<=n) {
            System.out.println("NO");
            return;
        }
        print();

    }

    public static void print(){

        StringBuilder  ans=new StringBuilder("");
        int count=0;
        for(int i=1;i<=n;i++){
            for(Integer t:list[i]) {
                count++;
                ans.append(i + " " + t + "\n");
            }
        }
        if(count==n-1) {
            System.out.println("YES");
            System.out.println(ans);
        }
        else
            System.out.println("NO");

    }
}