#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    gcd(b, a % b);
}
long long pwr(long long base, long long exp, long long mod = (1000000007LL)) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2) {
      res = (res * base) % mod;
    }
    base = (base * base) % mod;
    exp /= 2;
  }
  return res;
}
const int N = 1234;
int n, a, b;
int x[120], y[120];
int main() {
  scanf("%d %d %d", &n, &a, &b);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", x + i, y + i);
  }
  int res = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      for (int ez = 0; ez < 2; ++ez, swap(x[i], y[i])) {
        for (int pz = 0; pz < 2; ++pz, swap(x[j], y[j])) {
          if (x[i] + x[j] <= a and max(y[i], y[j]) <= b) {
            res = max(res, ((x[i] * y[i]) + (x[j] * y[j])));
          }
          if (x[i] + x[j] <= b and max(y[i], y[j]) <= a) {
            res = max(res, ((x[i] * y[i]) + (x[j] * y[j])));
          }
        }
      }
    }
  }
  cout << res << "\n";
  return 0;
}
