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