// Try Codeforces
// author: Leonardone @ NEETSDKASU
import std.stdio, std.string, std.array, std.algorithm, std.conv;

void main() {
    auto nab = to!(int[])(split(chomp(readln())));
    int n = nab[0], a = nab[1], b = nab[2];
    int ans = 0;
    int[101] u, w;
    for (int i = 0; i < n; i++) {
        auto xy = to!(int[])(split(chomp(readln())));
        int x = xy[0], y = xy[1];
        int s = x * y;
        if (x <= a && y <= b) {
            for (int j = 1; j < 101; j++) {
                if (u[j] > 0 && j + x <= a) {
                    ans = max(ans, u[j] + s);
                }
                if (w[j] > 0 && j + y <= b) {
                    ans = max(ans, w[j] + s);
                }
            }
        }
        if (y <= a && x <= b) {
            for (int j = 1; j < 101; j++) {
                if (u[j] > 0 && j + y <= a) {
                    ans = max(ans, u[j] + s);
                }
                if (w[j] > 0 && j + x <= b) {
                    ans = max(ans, w[j] + s);
                }
            }
        }
        if (x <= a && y <= b) { u[x] = max(u[x], s); w[y] = max(w[y], s); }
        if (y <= a && x <= b) { u[y] = max(u[y], s); w[x] = max(w[x], s); }
    }
    writeln(ans);
}