#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long ans(pair<long long, long long> a, pair<long long, long long> b,
              pair<long long, long long> c) {
  if (a.first < b.first || a.first < c.first) {
    return 0;
  }
  if (a.second < b.second || a.second < c.second) {
    return 0;
  }
  if (b.first + c.first <= a.first) {
    return (b.first * b.second + c.first * c.second);
  }
  if (b.second + c.second <= a.second) {
    return (b.first * b.second + c.first * c.second);
  }
  return 0;
}
signed main() {
  long long i, j, l, n, f, s;
  cin >> n >> f >> s;
  pair<long long, long long> fi = {f, s};
  vector<pair<long long, long long> > a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  long long answer = 0;
  for (j = 0; j < n; j++) {
    for (l = 0; l < j; l++) {
      pair<long long, long long> one = a[j], sec = a[l];
      answer = max(answer, ans(fi, one, sec));
      swap(one.first, one.second);
      answer = max(answer, ans(fi, one, sec));
      swap(sec.first, sec.second);
      answer = max(answer, ans(fi, one, sec));
      swap(one.first, one.second);
      answer = max(answer, ans(fi, one, sec));
    }
  }
  cout << answer << '\n';
  return 0;
}
