#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cout.tie(NULL);
  ;
  long long tt = 1;
  while (tt--) {
    long long n, a, b, ans = 0;
    cin >> n >> a >> b;
    vector<pair<long long, long long>> vv(n);
    for (long long i = 0; i < n; i++) {
      cin >> vv[i].first >> vv[i].second;
    }
    long long fans = 0;
    for (long long i = 0; i < n; i++) {
      for (long long j = i + 1; j < n; j++) {
        long long x = vv[i].first + vv[j].first;
        long long y = max(vv[i].second, vv[j].second);
        if (x <= a && y <= b || x <= b && y <= a)
          fans = max(fans,
                     vv[i].first * vv[i].second + vv[j].first * vv[j].second);
        x = vv[i].first + vv[j].second;
        y = max(vv[i].second, vv[j].first);
        if (x <= a && y <= b || x <= b && y <= a)
          fans = max(fans,
                     vv[i].first * vv[i].second + vv[j].first * vv[j].second);
        x = vv[j].second + vv[i].second;
        y = max(vv[i].first, vv[j].first);
        if (x <= a && y <= b || x <= b && y <= a)
          fans = max(fans,
                     vv[i].first * vv[i].second + vv[j].first * vv[j].second);
        x = vv[i].second + vv[j].first;
        y = max(vv[i].first, vv[j].second);
        if (x <= a && y <= b || x <= b && y <= a)
          fans = max(fans,
                     vv[i].first * vv[i].second + vv[j].first * vv[j].second);
      }
    }
    cout << fans << "\n";
  }
}
