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