import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.StringTokenizer;
import javafx.util.Pair;

public class Solve6 {

    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        new Solve6().solve(pw);
        pw.flush();
        pw.close();
    }

    public void solve(PrintWriter pw) {
        FastReader sc = new FastReader();
        int n = sc.nextInt(), d = sc.nextInt(), k = sc.nextInt();
        if (n <= d) {
            pw.println("NO");
        } else {
            int[] a = new int[d + 1];
            StringBuilder sb = new StringBuilder();
            for (int i = 1; i <= d; i++) {
                a[i] = d - Math.max(i - 1, d + 1 - i);
                sb.append(i).append(" ").append(i + 1).append("\n");
            }
            n -= d + 1;
            if (n == 0) {
                pw.println("YES");
                pw.print(sb.toString());
                return;
            }
            int curr = d + 1;
            for (int i = 2; i <= d; i++) {
                ArrayDeque<Pair<Integer, Integer>> p = new ArrayDeque();
                p.add(new Pair(i, a[i]));
                while (!p.isEmpty()) {
                    Pair<Integer, Integer> pair = p.pollLast();
                    int u = pair.getKey(), dep = pair.getValue();
                    if (dep == 0) {
                        break;
                    }
                    for (int j = 0; j < k - 1 - (dep == a[i] ? 1 : 0); j++) {
                        sb.append(u).append(" ").append(++curr).append("\n");
                        p.addFirst(new Pair(curr, dep - 1));
                        --n;
                        if (n == 0) {
                            pw.println("YES");
                            pw.print(sb.toString());
                            return;
                        }
                    }
                }
            }
        }
        pw.println("NO");
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
            }
        }

        public String next() {
            if (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public boolean hasNext() throws IOException {
            if (st != null && st.hasMoreTokens()) {
                return true;
            }
            String s = br.readLine();
            if (s == null || s.isEmpty()) {
                return false;
            }
            st = new StringTokenizer(s);
            return true;
        }
    }
}
