#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  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 maxi = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (v[i].first + v[j].first <= a && max(v[i].second, v[j].second) <= b) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      } else if (v[i].second + v[j].first <= a &&
                 max(v[i].first, v[j].second) <= b) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      } else if (v[i].first + v[j].second <= a &&
                 max(v[i].second, v[j].first) <= b) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      } else if (v[i].second + v[j].second <= a &&
                 max(v[i].first, v[j].first) <= b) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      } else if (v[i].first + v[j].first <= b &&
                 max(v[i].second, v[j].second) <= a) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      } else if (v[i].second + v[j].first <= b &&
                 max(v[i].first, v[j].second) <= a) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      } else if (v[i].first + v[j].second <= b &&
                 max(v[i].second, v[j].first) <= a) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      } else if (v[i].second + v[j].second <= b &&
                 max(v[i].first, v[j].first) <= a) {
        maxi = max(maxi, v[i].first * v[i].second + v[j].first * v[j].second);
      }
    }
  }
  cout << maxi << endl;
}
