#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e5 + 4;
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
  }
  return res;
}
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  vector<pair<int, int>> v;
  for (long long i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  int ans = 0;
  for (long long i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int x1 = v[i].first;
      int y1 = v[i].second;
      int x2 = v[j].first;
      int y2 = v[j].second;
      if (x1 + x2 <= a && max(y1, y2) <= b) ans = max(ans, x1 * y1 + x2 * y2);
      if (x1 + y2 <= a && max(y1, x2) <= b) ans = max(ans, x1 * y1 + x2 * y2);
      if (y1 + y2 <= b && max(x1, x2) <= a) ans = max(ans, x1 * y1 + x2 * y2);
      if (y1 + x2 <= a && max(x1, y2) <= b) ans = max(ans, x1 * y1 + x2 * y2);
      if (y1 + y2 <= a && max(x1, x2) <= b) ans = max(ans, x1 * y1 + x2 * y2);
      if (x1 + y2 <= b && max(y1, x2) <= a) ans = max(ans, x1 * y1 + x2 * y2);
      if (x2 + y1 <= b && max(y2, x1) <= a) ans = max(ans, x1 * y1 + x2 * y2);
      if (x1 + x2 <= b && max(y2, y1) <= a) ans = max(ans, x1 * y1 + x2 * y2);
    }
  }
  cout << ans << "\n";
  return 0;
}
