#include <bits/stdc++.h>
using namespace std;
long long n, a, b;
bool check(pair<long long, long long> a, pair<long long, long long> b) {
  if ((a.first + b.first) <= ::a && (a.second) <= ::b && (b.second) <= ::b)
    return 1;
  if ((a.first + b.second) <= ::a && (a.second) <= ::b && (b.first) <= ::b)
    return 1;
  if ((a.second + b.second) <= ::a && (a.first) <= ::b && (b.first) <= ::b)
    return 1;
  if ((a.second + b.first) <= ::a && (a.first) <= ::b && (b.second) <= ::b)
    return 1;
  swap(::a, ::b);
  if ((a.first + b.first) <= ::a && (a.second) <= ::b && (b.second) <= ::b)
    return 1;
  if ((a.first + b.second) <= ::a && (a.second) <= ::b && (b.first) <= ::b)
    return 1;
  if ((a.second + b.second) <= ::a && (a.first) <= ::b && (b.first) <= ::b)
    return 1;
  if ((a.second + b.first) <= ::a && (a.first) <= ::b && (b.second) <= ::b)
    return 1;
  return 0;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> a >> b;
  vector<pair<long long, long long> > v(n);
  for (auto &i : v) cin >> i.first >> i.second;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (check(v[i], v[j])) {
        ans = max(ans, (v[i].first * v[i].second + v[j].first * v[j].second));
      }
    }
  }
  cout << ans;
  return 0;
}
