#include <bits/stdc++.h>
using namespace std;
const long long LLINF = LLONG_MAX;
const int INF = INT_MAX;
const int MAXN = 1e2 + 10;
const int mod = 1e9 + 7;
int n, a, b;
int first[MAXN], second[MAXN];
int ans;
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i < n; i++) scanf("%d%d", &first[i], &second[i]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      for (int sw1 = 0; sw1 < 2; sw1++, swap(first[i], second[i]))
        for (int sw2 = 0; sw2 < 2; sw2++, swap(first[j], second[j]))
          for (int sw3 = 0; sw3 < 2; sw3++, swap(a, b))
            if (first[i] + first[j] <= a && max(second[i], second[j]) <= b)
              ans = max(ans, first[i] * second[i] + first[j] * second[j]);
  printf("%d\n", ans);
  return 0;
}
