#include <bits/stdc++.h>
using namespace std;
int n, xsize, ysize;
struct Yin {
  int x;
  int y;
};
Yin getyin(int xx, int yy) {
  Yin ret;
  ret.x = xx;
  ret.y = yy;
  return ret;
}
Yin yin[120 * 2];
bool ok(int id1, int id2) {
  if (yin[id1].x + yin[id2].x > xsize)
    if (yin[id1].y + yin[id2].y > ysize) return 0;
  if (yin[id1].x > xsize || yin[id1].y > ysize) return 0;
  if (yin[id2].x > xsize || yin[id2].y > ysize) return 0;
  return 1;
}
int getans(int id1, int id2) {
  int s1 = yin[id1].x * yin[id1].y;
  int s2 = yin[id2].x * yin[id2].y;
  return s1 + s2;
}
int ans = 0;
int main() {
  scanf("%d %d %d", &n, &xsize, &ysize);
  for (int i = 1; i <= n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    yin[i] = getyin(a, b);
    yin[i + n] = getyin(b, a);
  }
  for (int i = 1; i < n * 2; i++)
    for (int j = i + 1; j <= n * 2; j++)
      if (i + n != j)
        if (ok(i, j)) ans = max(ans, getans(i, j));
  printf("%d\n", ans);
}
