#include <bits/stdc++.h>
using namespace std;
struct pechat {
  int x, y;
};
pechat pech[105];
int s, t;
bool ok(pechat a, pechat b) {
  if (a.x + b.x <= s && a.y <= t && b.y <= t) return true;
  if (a.x + b.y <= s && a.y <= t && b.x <= t) return true;
  if (a.y + b.x <= s && a.x <= t && b.y <= t) return true;
  if (a.y + b.y <= s && a.x <= t && b.x <= t) return true;
  if (a.x + b.x <= t && a.y <= s && b.y <= s) return true;
  if (a.x + b.y <= t && a.y <= s && b.x <= s) return true;
  if (a.y + b.x <= t && a.x <= s && b.y <= s) return true;
  if (a.y + b.y <= t && a.x <= s && b.x <= s) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n >> s >> t;
  for (int i = 1; i <= n; i++) cin >> pech[i].x >> pech[i].y;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (ok(pech[i], pech[j]))
        ans = max(ans, pech[i].x * pech[i].y + pech[j].x * pech[j].y);
    }
  }
  cout << ans;
  return 0;
}
