#include <bits/stdc++.h>
using namespace std;
int n, a, b;
vector<pair<int, int> > p;
int check(int x1, int y1, int x2, int y2) {
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  swap(x1, y1);
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  swap(x2, y2);
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  swap(x1, y1);
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  swap(a, b);
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  swap(x1, y1);
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  swap(x2, y2);
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  swap(x1, y1);
  if (x1 + x2 <= a && y1 <= b && y2 <= b) return 1;
  return 0;
}
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    p.push_back(make_pair(x, y));
  }
  int max = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (check(p[i].first, p[i].second, p[j].first, p[j].second) &&
          p[i].first * p[i].second + p[j].first * p[j].second >= max)
        max = p[i].first * p[i].second + p[j].first * p[j].second;
  cout << max << endl;
  return 0;
}
