#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 50;
int w[maxn], h[maxn];
int main() {
  int n, a, b, ans = 0;
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i < n; i++) scanf("%d%d", &w[i], &h[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (i != j) {
        if (w[i] + w[j] <= a && max(h[i], h[j]) <= b)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
        if (w[i] + w[j] <= b && max(h[i], h[j]) <= a)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
        if (w[i] + h[j] <= a && max(w[j], h[i]) <= b)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
        if (w[i] + h[j] <= b && max(h[i], w[j]) <= a)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
        if (h[i] + h[j] <= b && max(w[i], w[j]) <= a)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
        if (h[i] + h[j] <= a && max(w[i], w[j]) <= b)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
        if (h[i] + w[j] <= b && max(w[i], h[j]) <= a)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
        if (h[i] + w[j] <= a && max(w[i], h[j]) <= b)
          ans = max(ans, w[i] * h[i] + w[j] * h[j]);
      }
  }
  printf("%d\n", ans);
  return 0;
}
