#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  while (y--) {
    res *= x;
  }
  return res;
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
bool sortbysec(const pair<long long, long long>& a,
               const pair<long long, long long>& b) {
  return (a.second < b.second);
}
void solve() {
  long long n, a, b;
  cin >> n >> a >> b;
  vector<pair<long long, long long> > v;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  long long g = 0;
  for (long long i = 0; i < n - 1; i++) {
    for (long long j = i + 1; j < n; j++) {
      long long p = v[i].first, q = v[i].second, r = v[j].first,
                s = v[j].second;
      if ((p + r <= a && max(q, s) <= b) || (q + s <= b && max(p, r) <= a) ||
          (p + r <= b && max(q, s) <= a) || (q + s <= a && max(p, r) <= b)) {
        g = max(g, ((p * q) + (r * s)));
      } else {
        long long t = p;
        p = q;
        q = t;
        if ((p + r <= a && max(q, s) <= b) || (q + s <= b && max(p, r) <= a) ||
            (p + r <= b && max(q, s) <= a) || (q + s <= a && max(p, r) <= b)) {
          g = max(g, ((p * q) + (r * s)));
        }
      }
    }
  }
  cout << g;
}
int main() {
  fast();
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
