#include <bits/stdc++.h>
int max(int a, int b) { return a < b ? b : a; }
int min(int a, int b) { return a < b ? a : b; }
void swap(int *a, int *b) {
  int t = *a;
  *a = *b;
  *b = t;
}
int can(int x, int y, int a, int b) {
  if ((x <= a && y <= b) || (x <= b && y <= a)) return 1;
  return 0;
}
int cal(int x1, int y1, int x2, int y2, int a, int b) {
  if (x1 > y1) swap(&x1, &y1);
  if (x2 > y2) swap(&x2, &y2);
  if (can(x1 + x2, max(y1, y2), a, b)) return x1 * y1 + x2 * y2;
  if (can(max(x1, x2), y1 + y2, a, b)) return x1 * y1 + x2 * y2;
  if (can(max(x2, y1), x1 + y2, a, b)) return x1 * y1 + x2 * y2;
  if (can(max(x1, y2), y1 + x2, a, b)) return x1 * y1 + x2 * y2;
  return 0;
}
int main() {
  int maxx = 0, n, a, b, i, j, s[200][2];
  scanf("%d %d %d", &n, &a, &b);
  for (i = 0; i < n; i++) scanf("%d %d", &s[i][0], &s[i][1]);
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      int k = cal(s[i][0], s[i][1], s[j][0], s[j][1], a, b);
      if (maxx < k) maxx = k;
    }
  }
  printf("%d\n", maxx);
  return 0;
}
