#include <bits/stdc++.h>
using namespace std;
const int mx = 112;
bool can(int h, int w, int x0, int y0, int x1, int y1) {
  if (x0 <= h && x1 <= h) {
    if (y0 + y1 <= w) return 1;
  }
  return 0;
}
bool check(int a, int b, int x0, int y0, int x1, int y1) {
  if (can(a, b, x0, y0, x1, y1)) return 1;
  if (can(a, b, y0, x0, x1, y1)) return 1;
  if (can(a, b, x0, y0, y1, x1)) return 1;
  if (can(a, b, y0, x0, y1, x1)) return 1;
  return 0;
}
pair<int, int> v[mx];
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int area = v[i].first * v[i].second + v[j].first * v[j].second;
      if (check(a, b, v[i].first, v[i].second, v[j].first, v[j].second))
        ans = max(ans, area);
      if (check(b, a, v[i].first, v[i].second, v[j].first, v[j].second))
        ans = max(ans, area);
    }
  }
  cout << ans << endl;
}
