#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int n, a, b;
int max(int a, int b) {
  if (a > b) return a;
  return b;
}
bool checkNorm(pair<int, int> f, pair<int, int> s) {
  int x1, y1;
  x1 = max(f.first, s.first), y1 = f.second + s.second;
  if (x1 <= a && y1 <= b) return 1;
  y1 = max(f.second, s.second), x1 = f.first + s.first;
  if (x1 <= a && y1 <= b) return 1;
  return 0;
}
pair<int, int> rotate(pair<int, int> p) {
  swap(p.first, p.second);
  return p;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  int mx = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (checkNorm(v[i], v[j])) {
        mx = max(mx, v[i].first * v[i].second + v[j].first * v[j].second);
      }
      if (checkNorm(v[i], rotate(v[j]))) {
        mx = max(mx, v[i].first * v[i].second + v[j].first * v[j].second);
      }
      if (checkNorm(rotate(v[i]), (v[j]))) {
        mx = max(mx, v[i].first * v[i].second + v[j].first * v[j].second);
      }
      if (checkNorm(rotate(v[i]), rotate(v[j]))) {
        mx = max(mx, v[i].first * v[i].second + v[j].first * v[j].second);
      }
    }
  }
  cout << mx;
  return 0;
}
