#include <bits/stdc++.h>
using namespace std;
struct seal {
  int x, y;
};
int a, b, n;
seal s[101];
bool judge(const seal &s1, const seal &s2) {
  if (s1.x + s2.x <= a && max(s1.y, s2.y) <= b) return true;
  if (s1.x + s2.x <= b && max(s1.y, s2.y) <= a) return true;
  if (s1.x + s2.y <= a && max(s1.y, s2.x) <= b) return true;
  if (s1.x + s2.y <= b && max(s1.y, s2.x) <= a) return true;
  if (s1.y + s2.x <= a && max(s1.x, s2.y) <= b) return true;
  if (s1.y + s2.x <= b && max(s1.x, s2.y) <= a) return true;
  if (s1.y + s2.y <= a && max(s1.x, s2.x) <= b) return true;
  if (s1.y + s2.y <= b && max(s1.x, s2.x) <= a) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  while (cin >> n >> a >> b) {
    for (int i = 1; i <= n; i++) cin >> s[i].x >> s[i].y;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (judge(s[i], s[j]))
          ans = max(ans, s[i].x * s[i].y + s[j].y * s[j].x);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
