#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int x[105], y[105];
int ans;
bool judge(int x1, int x2, int y1, int y2) {
  if (x1 + x2 <= a && max(y1, y2) <= b) {
    return 1;
  }
  if (x1 + x2 <= b && max(y1, y2) <= a) {
    return 1;
  }
  if (x1 + y2 <= a && max(y1, x2) <= b) {
    return 1;
  }
  if (x1 + y2 <= b && max(y1, x2) <= a) {
    return 1;
  }
  if (y1 + x2 <= a && max(x1, y2) <= b) {
    return 1;
  }
  if (y1 + x2 <= b && max(x1, y2) <= a) {
    return 1;
  }
  if (y1 + y2 <= a && max(x1, x2) <= b) {
    return 1;
  }
  if (y1 + y2 <= b && max(x1, x2) <= a) {
    return 1;
  }
  return 0;
}
int main() {
  int i, j;
  cin >> n >> a >> b;
  for (i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j < i; j++) {
      if (judge(x[i], x[j], y[i], y[j]) == 1) {
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      }
    }
  }
  cout << ans;
  return 0;
}
