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



public class Main {
    private static int N,D,K,n;
    private static int [] par = new int[1 << 20];

    private static boolean dfs(int u,int p,int L,int H) {
        par[u] = p;
        if (n == N) return true;
        if (H == 0) return true;
        int h = Math.min(H,D/2);
        h = Math.min(h,D - L);
        int deg = K;
        int f = 1,t = 1 + D;
        if (u <= t) h = Math.min(h,L);
        int mxL = L;
        if (f <= u && u < t){
            int v = ++n;
            dfs(v,u,L+1,D - L - 1);
            deg -= 2;
        }
        else deg--;
        if (u == 1) deg++;
        if (K < 0) return false;
//        System.err.println(u + " " + h);
        while (h > 0 && deg > 0 && n < N) {
            int v = ++n;
            if (!dfs(v,u,mxL,h - 1)) return false;
            h = Math.min(h,D - h);
            deg--;
        }
        return true;
    }

    public static void main(String[] args) throws Exception {
        IO io ;
        try {
            io = new IO("in.in", null);
        } catch (IOException e) {
            io = new IO(null, null);
        }
        N = io.getNextInt();
        D = io.getNextInt();
        K = io.getNextInt();
        if(D < N && dfs((n = 1),0,0,D) && n == N) {
            io.println("YES");
            for (int u = 2;u <= n;u++)
                io.println(par[u] + " " + u);
        }
        else io.println("NO");
        io.close();
    }
    private static final int onebillion7 = 1000000007;
}


class IO{
    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter writer;
    private String inputFile,outputFile;

    public boolean hasMore() throws IOException{
        if(st != null && st.hasMoreTokens()) return true;
        if(br != null && br.ready()) return true;
        return false;
    }

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

    public String getNextLine() throws FileNotFoundException, IOException{
        return br.readLine().trim();
    }

    public int getNextInt() throws FileNotFoundException, IOException{
        return Integer.parseInt(getNext());
    }
    public long getNextLong() throws FileNotFoundException, IOException{
        return Long.parseLong(getNext());
    }

    public void print(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f" ,x);
    }
    public void println(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f\n" ,x);
    }
    public void print(Object o) throws  IOException{
        writer.print(o.toString());
    }

    public void println(Object o) throws  IOException{
        writer.println(o.toString());
    }
    public IO(String x,String y) throws FileNotFoundException, IOException{
        inputFile = x;
        outputFile = y;
        if(x != null) br = new BufferedReader(new FileReader(inputFile));
        else br = new BufferedReader(new InputStreamReader(System.in));
        if(y != null) writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
        else writer = new PrintWriter(new OutputStreamWriter(System.out));
    }

    protected void close() throws IOException{
        br.close();
        writer.close();
    }
    public void outputArr(Object [] A) throws IOException{
        int L = A.length;
        for (int i = 0;i < L;i++) {
            if(i > 0) writer.print(" ");
            writer.print(A[i]);
        }
        writer.print("\n");
    }
}
