#include <bits/stdc++.h>
int x[105], y[105];
bool judge(int i, int j, int w, int h) {
  if (x[i] + x[j] <= w && y[i] <= h && y[j] <= h) {
    return true;
  }
  if (x[i] + y[j] <= w && y[i] <= h && x[j] <= h) {
    return true;
  }
  if (y[i] + x[j] <= w && x[i] <= h && y[j] <= h) {
    return true;
  }
  if (y[i] + y[j] <= w && x[i] <= h && x[j] <= h) {
    return true;
  }
  return false;
}
int main() {
  bool flag;
  int i, j, n, a, b, ans = 0, s;
  scanf("%d%d%d", &n, &a, &b);
  for (i = 0; i < n; ++i) {
    scanf("%d%d", x + i, y + i);
  }
  for (i = 0; i < n; ++i) {
    for (j = i + 1; j < n; ++j) {
      flag = false;
      if (judge(i, j, a, b)) {
        flag = true;
      }
      if (judge(i, j, b, a)) {
        flag = true;
      }
      if (flag) {
        s = x[i] * y[i] + x[j] * y[j];
        if (s > ans) {
          ans = s;
        }
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
