#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, a, b;
  cin >> n >> a >> b;
  vector<pair<int, int>> p;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    p.push_back({x, y});
  }
  int m = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (i != j) {
        if ((p[i].first + p[j].first <= a && p[i].second <= b &&
             p[j].second <= b) ||
            (p[i].second + p[j].second <= b && p[i].first <= a &&
             p[j].first <= a) ||
            (p[i].first + p[j].first <= b && p[i].second <= a &&
             p[j].second <= a) ||
            (p[i].second + p[j].second <= a && p[i].first <= b &&
             p[j].first <= b) ||
            (p[i].first + p[j].second <= a && p[i].second <= b &&
             p[j].first <= b) ||
            (p[i].second + p[j].first <= b && p[i].first <= a &&
             p[j].second <= a) ||
            (p[i].first + p[j].second <= b && p[i].second <= a &&
             p[j].first <= a) ||
            (p[i].second + p[j].first <= a && p[i].first <= b &&
             p[j].second <= b))
          m = max(m,
                  p[i].first * p[i].second + p[j].first * p[j].second <= a * b
                      ? p[i].first * p[i].second + p[j].first * p[j].second
                      : 0);
      }
    }
  }
  cout << m;
  return 0;
}
