#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a, b;
  cin >> n >> a >> b;
  vector<pair<int, int> > seals(n);
  for (int i = 0; i < n; i++) cin >> seals[i].first >> seals[i].second;
  int best = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      bool fit = false;
      if (seals[i].first + seals[j].first <= a and
          max(seals[i].second, seals[j].second) <= b)
        fit = true;
      if (seals[i].first + seals[j].first <= b and
          max(seals[i].second, seals[j].second) <= a)
        fit = true;
      if (seals[i].second + seals[j].second <= a and
          max(seals[i].first, seals[j].first) <= b)
        fit = true;
      if (seals[i].second + seals[j].second <= b and
          max(seals[i].first, seals[j].first) <= a)
        fit = true;
      if (seals[i].first + seals[j].second <= a and
          max(seals[i].second, seals[j].first) <= b)
        fit = true;
      if (seals[i].first + seals[j].second <= b and
          max(seals[i].second, seals[j].first) <= a)
        fit = true;
      if (fit)
        best = max(best, seals[i].first * seals[i].second +
                             seals[j].first * seals[j].second);
    }
  cout << best << endl;
  return 0;
}
