#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 5;
int n, a, b, x[105], y[105];
bool judge(int i, int j) {
  int h = max(a, b), w = min(a, b);
  if (max(max(x[i], x[j]), y[i] + y[j]) <= h &&
      min(max(x[i], x[j]), y[i] + y[j]) <= w)
    return true;
  if (max(max(x[i], y[j]), y[i] + x[j]) <= h &&
      min(max(x[i], y[j]), y[i] + x[j]) <= w)
    return true;
  if (max(x[i] + x[j], max(y[i], y[j])) <= h &&
      min(x[i] + x[j], max(y[i], y[j])) <= w)
    return true;
  if (max(max(y[i], x[j]), x[i] + y[j]) <= h &&
      min(max(y[i], x[j]), x[i] + y[j]) <= w)
    return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> a >> b;
  for (int i = 1; i <= n; ++i) cin >> x[i] >> y[i];
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (judge(i, j)) ans = max(ans, x[i] * y[i] + x[j] * y[j]);
    }
  }
  cout << ans << endl;
  return 0;
}
