#include <bits/stdc++.h>
using namespace std;
bool Check(int X1, int Y1, int X2, int Y2, int a, int b) {
  bool answ = false;
  if (X1 <= a && X2 <= a && Y1 <= b && Y2 <= b)
    if (!(X1 + X2 > a) || !(Y1 + Y2 > b)) answ = true;
  if (Y1 <= a && X2 <= a && X1 <= b && Y2 <= b)
    if (!(Y1 + X2 > a) || !(X1 + Y2 > b)) answ = true;
  if (X1 <= a && Y2 <= a && Y1 <= b && X2 <= b)
    if (!(X1 + Y2 > a) || !(Y1 + X2 > b)) answ = true;
  if (Y1 <= a && Y2 <= a && X1 <= b && X2 <= b)
    if (!(Y1 + Y2 > a) || !(X1 + X2 > b)) answ = true;
  return answ;
}
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  char XY[n][2];
  for (int i = 0; i < n; i++) {
    int Xi, Yi;
    cin >> Xi >> Yi;
    XY[i][0] = Xi;
    XY[i][1] = Yi;
  }
  int maxS = 0;
  for (int i = 0; i < n - 1; i++) {
    int X1 = XY[i][0];
    int Y1 = XY[i][1];
    for (int j = i + 1; j < n; j++) {
      int X2 = XY[j][0];
      int Y2 = XY[j][1];
      if (Check(X1, Y1, X2, Y2, a, b) == true) {
        maxS = max(maxS, X1 * Y1 + X2 * Y2);
      }
    }
  }
  cout << maxS;
  return 0;
}
