#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, a1, a2, maxans = 0, x, y;
  vector<pair<int, int> > v;
  pair<int, int> p1, p2;
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x * y > a * b) continue;
    if (x > a && x > b) continue;
    if (y > a && y > b) continue;
    v.push_back(make_pair(x, y));
  }
  int l = v.size();
  for (int i = 0; i < l; i++) {
    for (int j = i + 1; j < l; j++) {
      p1 = v[i];
      p2 = v[j];
      a1 = p1.first * p1.second;
      a2 = p2.first * p2.second;
      int x1 = min(p1.first, p2.first);
      int x2 = max(p1.first, p2.first);
      int y1 = min(p1.second, p2.second);
      int y2 = max(p1.second, p2.second);
      if (x1 + x2 <= a && y1 <= b && y2 <= b) {
        maxans = max(maxans, a1 + a2);
      }
      if (x1 + x2 <= b && y1 <= a && y2 <= a) maxans = max(maxans, a1 + a2);
      if (y1 + y2 <= a && x1 <= b && x2 <= b) maxans = max(maxans, a1 + a2);
      if (y1 + y2 <= b && x1 <= a && x2 <= a) maxans = max(maxans, a1 + a2);
      int temp = p1.first;
      p1.first = p1.second;
      p1.second = temp;
      x1 = min(p1.first, p2.first);
      x2 = max(p1.first, p2.first);
      y1 = min(p1.second, p2.second);
      y2 = max(p1.second, p2.second);
      if (x1 + x2 <= a && y1 <= b && y2 <= b) {
        maxans = max(maxans, a1 + a2);
      }
      if (x1 + x2 <= b && y1 <= a && y2 <= a) maxans = max(maxans, a1 + a2);
      if (y1 + y2 <= a && x1 <= b && x2 <= b) maxans = max(maxans, a1 + a2);
      if (y1 + y2 <= b && x1 <= a && x2 <= a) maxans = max(maxans, a1 + a2);
    }
  }
  cout << maxans;
  return 0;
}
