#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 5;
pair<int, int> flip(pair<int, int> a) { return {a.second, a.first}; }
int area(pair<int, int> a) { return a.first * a.second; }
bool possible(pair<int, int> a, pair<int, int> b, int x, int y) {
  if (x - a.first < 0 || y - a.second < 0) return 0;
  pair<int, int> parts[] = {{x - a.first, y}, {x, y - a.second}};
  for (pair<int, int> &z : parts)
    if (b.first <= z.first && b.second <= z.second) return 1;
  return 0;
}
int main() {
  cin.tie(0), cin.sync_with_stdio(0);
  int n, a, b;
  cin >> n >> a >> b;
  vector<pair<int, int> > v(n);
  for (pair<int, int> &p : v) cin >> p.first >> p.second;
  int ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (possible(v[i], v[j], a, b) || possible(flip(v[i]), v[j], a, b) ||
          possible(v[i], flip(v[j]), a, b) ||
          possible(flip(v[i]), flip(v[j]), a, b))
        ans = max(ans, area(v[i]) + area(v[j]));
  cout << ans;
}
