#include <bits/stdc++.h>
int max(int a, int b) { return a > b ? a : b; }
int check(int a, int b, int c, int d, int e, int f) {
  return max(a, c) <= e && b + d <= f;
}
int check1(int a, int b, int c, int d, int e, int f) {
  return check(a, b, c, d, e, f) || check(b, a, c, d, e, f);
}
int check2(int a, int b, int c, int d, int e, int f) {
  return check1(a, b, c, d, e, f) || check1(a, b, d, c, e, f);
}
int check3(int a, int b, int c, int d, int e, int f) {
  return check2(a, b, c, d, e, f) || check2(a, b, c, d, f, e);
}
int main() {
  static int xx[100], yy[100];
  int n, a, b, i, j, ans;
  scanf("%d%d%d", &n, &a, &b);
  for (i = 0; i < n; i++) scanf("%d%d", &xx[i], &yy[i]);
  ans = 0;
  for (i = 0; i < n; i++)
    for (j = i + 1; j < n; j++)
      if (check3(xx[i], yy[i], xx[j], yy[j], a, b))
        ans = max(ans, xx[i] * yy[i] + xx[j] * yy[j]);
  printf("%d\n", ans);
  return 0;
}
