#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void MAX(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline void MIN(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void rd(T &x) {
  x = 0;
  char o, f = 1;
  while (o = getchar(), o < 48)
    if (o == '-') f = -f;
  do x = (x << 3) + (x << 1) + (o ^ 48);
  while (o = getchar(), o > 47);
  x *= f;
}
const int M = 105;
int n, a, b, A[M], B[M];
bool chk(int a, int b, int c, int d) {
  return a >= c && b >= d || a >= d && b >= c;
}
int main() {
  rd(n), rd(a), rd(b);
  for (int i = 1; i <= n; i++) rd(A[i]), rd(B[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (chk(a - A[i], b, A[j], B[j]) && b >= B[i])
        MAX(ans, A[i] * B[i] + A[j] * B[j]);
      if (chk(a, b - B[i], A[j], B[j]) && a >= A[i])
        MAX(ans, A[i] * B[i] + A[j] * B[j]);
      if (chk(a - B[i], b, A[j], B[j]) && b >= A[i])
        MAX(ans, A[i] * B[i] + A[j] * B[j]);
      if (chk(a, b - A[i], A[j], B[j]) && a >= B[i])
        MAX(ans, A[i] * B[i] + A[j] * B[j]);
    }
  printf("%d\n", ans);
  return 0;
}
