#include <bits/stdc++.h>
using namespace std;
struct Stamp {
  int x, y;
  Stamp() {}
  Stamp(int _x, int _y) { x = _x, y = _y; }
  int square() { return x * y; }
};
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  vector<Stamp> s;
  int wrong = 0;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    if (x > a && x > b || y > a && y > b)
      wrong++;
    else
      s.push_back(Stamp(x, y));
  }
  n -= wrong;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (s[i].x + s[j].x <= a && s[i].y <= b && s[j].y <= b ||
          s[i].x + s[j].x <= b && s[i].y <= a && s[j].y <= a ||
          s[i].x + s[j].y <= a && s[i].y <= b && s[j].x <= b ||
          s[i].x + s[j].y <= b && s[i].y <= a && s[j].x <= a ||
          s[i].y + s[j].x <= a && s[i].x <= b && s[j].y <= b ||
          s[i].y + s[j].x <= b && s[i].x <= a && s[j].y <= a ||
          s[i].y + s[j].y <= a && s[i].x <= b && s[j].x <= b ||
          s[i].y + s[j].y <= b && s[i].x <= a && s[j].x <= a)
        ans = max(ans, s[i].square() + s[j].square());
    }
  }
  cout << ans << endl;
  return 0;
}
