#include <bits/stdc++.h>
using namespace std;
struct pt {
  int x, y, index;
};
int main() {
  int n, a, b, ms = 0, s;
  cin >> n >> a >> b;
  vector<pt> tr;
  for (int i = 0; i < n; i++) {
    int x2, y2;
    cin >> x2 >> y2;
    pt a;
    a.x = x2;
    a.y = y2;
    a.index = i;
    tr.push_back(a);
    a.x = y2;
    a.y = x2;
    tr.push_back(a);
  }
  for (int i = 0; i < tr.size(); i++)
    for (int j = 0; j < tr.size(); j++) {
      if (tr[i].index == tr[j].index) {
        continue;
      }
      if ((tr[i].x + tr[j].x <= a || tr[i].y + tr[j].y <= b) && tr[i].x <= a &&
          tr[i].y <= b && tr[j].x <= a && tr[j].y <= b) {
        ms = max(tr[i].x * tr[i].y + tr[j].x * tr[j].y, ms);
      }
    }
  cout << ms << endl;
  return 0;
}
