#include <bits/stdc++.h>
using namespace std;
const int nmax = 1e2 + 3;
int xSize[nmax], ySize[nmax], n, a, b;
void openf() {
  int i;
  cin >> n >> a >> b;
  for (i = 1; i <= n; i++) cin >> xSize[i] >> ySize[i];
}
bool fit_area(int i, int a, int b) {
  return (xSize[i] <= a && ySize[i] <= b) || (ySize[i] <= a && xSize[i] <= b);
}
void process() {
  int res = 0, i, j, k;
  for (i = 1; i <= a / 2; i++)
    for (j = 1; j <= n; j++)
      for (k = 1; k <= n; k++)
        if (j != k && fit_area(j, i, b) && fit_area(k, a - i, b))
          res = max(res, xSize[j] * ySize[j] + xSize[k] * ySize[k]);
  for (i = 1; i <= b / 2; i++)
    for (j = 1; j <= n; j++)
      for (k = 1; k <= n; k++)
        if (j != k && fit_area(j, a, i) && fit_area(k, a, b - i))
          res = max(res, xSize[j] * ySize[j] + xSize[k] * ySize[k]);
  cout << res;
}
int main() {
  openf();
  process();
}
