#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
signed main() {
  ios::sync_with_stdio(false);
  long long n, a, b;
  cin >> n >> a >> b;
  long long ans = 0;
  vector<long long> x(n), y(n);
  for (long long i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    for (long long j = 0; j < i; j++) {
      for (long long _ = 2; _--;) {
        for (long long __ = 2; __--;) {
          for (long long ___ = 2; ___--;) {
            if (x[i] + x[j] <= a && max(y[i], y[j]) <= b) {
              ans = max(ans, x[i] * y[i] + x[j] * y[j]);
            }
            swap(x[j], y[j]);
          }
          swap(x[i], y[i]);
        }
        swap(a, b);
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
