#include <bits/stdc++.h>
struct seal {
  int x, y;
  int s;
};
seal s[105];
int n, a, b;
int ans;
void solve(int i, int j) {
  if (s[i].x + s[j].x <= a) {
    if (s[i].y <= b && s[j].y <= b) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
  if (s[i].x + s[j].x <= b) {
    if (s[i].y <= a && s[j].y <= a) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
  if (s[i].x + s[j].y <= a) {
    if (s[i].y <= b && s[j].x <= b) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
  if (s[i].x + s[j].y <= b) {
    if (s[i].y <= a && s[j].x <= a) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
  if (s[i].y + s[j].y <= a) {
    if (s[i].x <= b && s[j].x <= b) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
  if (s[i].y + s[j].y <= b) {
    if (s[i].x <= a && s[j].x <= a) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
  if (s[i].y + s[j].x <= a) {
    if (s[i].x <= b && s[j].y <= b) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
  if (s[i].y + s[j].x <= b) {
    if (s[i].x <= a && s[j].y <= a) {
      if (s[i].s + s[j].s > ans) ans = s[i].s + s[j].s;
      return;
    }
  }
}
int main() {
  while (~scanf("%d %d %d", &n, &a, &b)) {
    ans = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d %d", &s[i].x, &s[i].y);
      s[i].s = s[i].x * s[i].y;
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        solve(i, j);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
