#include <bits/stdc++.h>
using namespace std;
int ans, x[233], y[233], a, b, n, m, flag, len, k, cnt[233], sum, bo[2333];
char map[233][233];
char s[1000000 + 10];
int check(int x, int y, int p, int q) {
  return x + p <= a && max(y, q) <= b || max(x, p) <= a && y + q <= b;
}
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; ++i) scanf("%d%d", &x[i], &y[i]);
  for (int i = 1; i < n; ++i)
    for (int j = i + 1; j <= n; ++j)
      if (check(x[i], y[i], x[j], y[j]) || check(x[i], y[i], y[j], x[j]) ||
          check(y[i], x[i], x[j], y[j]) || check(y[i], x[i], y[j], x[j]))
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
  printf("%d", ans);
  return 0;
}
