import java.io.*;
import java.lang.reflect.Array;
import java.util.*;


public class Main {

    String fileName = "";

    //////////////////////    SOLUTION   SOLUTION  SOLUTION    //////////////////////////////
    int INF = Integer.MAX_VALUE;


    void solve() throws IOException {

        int n = readInt();
        int diam = readInt();
        int deg = readInt();
        if(diam == n || deg == n){
            System.out.println("-1");
            return;
        }
        int ix = 0;
        int[][] stat = new int[n][2]; //[0] = diam, [1] = deg
        int[][] edges = new int[n][2];
        for(int i = 0; i < diam+1; i++){ //set longest path
            stat[i][0] = diam-Math.min(i, diam-i);
            stat[i][1] = 2;
            edges[ix][0] = i+1;
            edges[ix][1] = i+2;
            ix++;
        }
        ix--;
        stat[0][1] = 1; //set deg
        stat[diam][1] = 1;
        int jix = 1;
        for(int i = diam+1; i < n; i++){  //connect remaining vertices
            for(int j = jix; j < n; j++){
                if(i == j)
                    continue;
                if(stat[j][1] < deg && stat[j][0] < diam && stat[i][1] < deg && stat[i][0] < diam && (stat[i][0] > 0 || stat[j][0] > 0)){
                    stat[j][1]++;
                    stat[i][0] = stat[j][0]+1;
                    stat[i][1]++;
                    edges[ix][0]=j+1;
                    edges[ix][1]=i+1;
                    ix++;
                    break;
                }
                jix++;
            }
        }
        if(ix == n-1){
            System.out.println("YES");
            for(int i = 0; i < ix; i++)
                System.out.println(edges[i][0]+ " " + edges[i][1]);
        }
        else
            System.out.println("NO");
    }

    ////////////////////////////////////////////////////////////



    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new Main().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    };

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";
    Random rnd = new Random();

    Main() throws FileNotFoundException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken();
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }
    byte readByte() throws NumberFormatException, IOException {
        return Byte.parseByte(readString());
    }
    int[] readIntArray (int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    Integer[] readIntegerArray (int n) throws NumberFormatException, IOException {
        Integer[] a = new Integer[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}