#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, a, b, mx = 0;
  cin >> n >> a >> b;
  long long x[n + 1], y[n + 1];
  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) {
      bool ok = 0;
      if (x[i] + x[j] <= a && max(y[i], y[j]) <= b) ok = 1;
      if (x[i] + y[j] <= a && max(y[i], x[j]) <= b) ok = 1;
      if (y[i] + x[j] <= a && max(x[i], y[j]) <= b) ok = 1;
      if (y[i] + y[j] <= a && max(x[i], x[j]) <= b) ok = 1;
      if (x[i] + x[j] <= b && max(y[i], y[j]) <= a) ok = 1;
      if (x[i] + y[j] <= b && max(y[i], x[j]) <= a) ok = 1;
      if (y[i] + x[j] <= b && max(x[i], y[j]) <= a) ok = 1;
      if (y[i] + y[j] <= b && max(x[i], x[j]) <= a) ok = 1;
      if (ok) mx = max(mx, x[i] * y[i] + x[j] * y[j]);
    }
  }
  cout << mx;
}
int main() {
  long long T = 1;
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  while (T--) solve();
  return 0;
}
