#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const long long N = 1000;
long long n, a, b, ans = 0;
long long x[N], y[N];
void calc(long long x1, long long y1, long long x2, long long y2) {
  if ((x1 + x2) <= a && max(y1, y2) <= b) ans = max(ans, x1 * y1 + x2 * y2);
  if ((x1 + x2) <= b && max(y1, y2) <= a) ans = max(ans, x1 * y1 + x2 * y2);
}
void solve() {
  cin >> n >> a >> b;
  for (long long i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) {
      calc(x[i], y[i], x[j], y[j]);
      calc(x[i], y[i], y[j], x[j]);
      calc(y[i], x[i], x[j], y[j]);
      calc(y[i], x[i], y[j], x[j]);
    }
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
