#include <bits/stdc++.h>
using namespace std;
struct stamp {
  long long int x, y;
};
vector<stamp> D(101);
int main() {
  long long int n, a, b;
  cin >> n >> a >> b;
  for (long long int i = 0; i < n; i++) {
    cin >> D[i].x >> D[i].y;
  }
  long long int maxi = 0;
  long long int temp;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      temp = 0;
      if (D[i].x + D[j].x <= a) {
        if (max(D[i].y, D[j].y) <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (D[i].x + D[j].y <= a) {
        if (max(D[i].y, D[j].x) <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (D[i].y + D[j].x <= a) {
        if (max(D[i].x, D[j].y) <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (D[i].y + D[j].y <= a) {
        if (max(D[i].x, D[j].x) <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (max(D[i].x, D[j].x) <= a) {
        if (D[i].y + D[j].y <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (max(D[i].x, D[j].y) <= a) {
        if (D[i].y + D[j].x <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (max(D[i].y, D[j].x) <= a) {
        if (D[i].x + D[j].y <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (max(D[i].y, D[j].y) <= a) {
        if (D[i].x + D[j].x <= b) {
          temp = D[i].x * D[i].y + D[j].x * D[j].y;
        }
      }
      if (temp > maxi) {
        maxi = temp;
      }
    }
  }
  cout << maxi << endl;
  return 0;
}
