#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int x[203], y[203];
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &x[i], &y[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n; ++j)
      if ((x[i] + x[j] <= a && max(y[i], y[j]) <= b) ||
          (x[i] + x[j] <= b && max(y[i], y[j]) <= a) ||
          (x[i] + y[j] <= a && max(x[j], y[i]) <= b) ||
          (x[i] + y[j] <= b && max(x[j], y[i]) <= a) ||
          (x[j] + y[i] <= a && max(x[i], y[j]) <= b) ||
          (x[j] + y[i] <= b && max(x[i], y[j]) <= a) ||
          (y[i] + y[j] <= a && max(x[i], x[j]) <= b) ||
          (y[i] + y[j] <= b && max(x[i], x[j]) <= a))
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
  printf("%d\n", ans);
  return 0;
}
