#include <bits/stdc++.h>
using namespace std;
int n, a, b, x[110], y[110], mx;
int main() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (int i = 1; i < n; i++) {
    if ((x[i] > a || y[i] > b) && (x[i] > b || y[i] > a)) continue;
    for (int j = i + 1; j <= n; j++) {
      if ((x[j] > a || y[j] > b) && (x[j] > b || y[j] > a)) continue;
      int lx1 = a - x[j], ly1 = b - y[j], lx2 = a - y[j], ly2 = b - x[j];
      if ((lx1 >= 0 && ly1 >= 0)) {
        if (!((x[i] > lx1 || y[i] > b) && (x[i] > b || y[i] > lx1) &&
              (x[i] > ly1 || y[i] > a) && (x[i] > a || y[i] > ly1))) {
          mx = max(mx, x[i] * y[i] + x[j] * y[j]);
        }
      }
      if ((lx2 >= 0 && ly2 >= 0)) {
        if (!((x[i] > lx2 || y[i] > b) && (x[i] > b || y[i] > lx2) &&
              (x[i] > ly2 || y[i] > a) && (x[i] > a || y[i] > ly2))) {
          mx = max(mx, x[i] * y[i] + x[j] * y[j]);
        }
      }
    }
  }
  cout << mx << endl;
  return 0;
}
