#include <bits/stdc++.h>
using namespace std;
long long n, m, s, t, k, a, b, x, y, u;
const int mod = 1e9 + 7;
const int mxn = 2e5 + 5;
long long mn = 1e18, mx = 0;
long long arr[2000000], wan[2000000], finl[2000000];
string str, str2;
string str4 = "abcdefghijklmnopqrstuvwxyz";
long long ans = 0;
multiset<pair<long long, long long>> st;
long long num1, num2;
long long tmp;
void ok(long long xx, long long yy) {
  auto it = st.lower_bound({xx, yy});
  tie(num1, num2) = *it;
  if (it != st.begin() && (xx < num1 || yy < num2)) it--;
  if (it == st.end() && it != st.begin()) it--;
  tie(num1, num2) = *it;
  while (xx < num1 || yy < num2) {
    if (it == st.begin()) return;
    it--;
    tie(num1, num2) = *it;
  }
  ans = max(tmp + (num1 * num2), ans);
}
int main() {
  ios_base::sync_with_stdio(0);
  t = 1;
  while (t--) {
    cin >> n >> x >> y;
    for (int i = 0; i < n; i++) {
      cin >> arr[i] >> wan[i];
      st.insert({arr[i], wan[i]});
    }
    for (int i = 0; i < n; i++) {
      if (arr[i] <= x && wan[i] <= y) {
        long long xx, yy;
        xx = x - arr[i];
        yy = y;
        tmp = arr[i] * wan[i];
        st.erase(st.find({arr[i], wan[i]}));
        if (xx >= 0 && yy >= 0 && st.size()) {
          if (xx > 0 && yy > 0) {
            ok(xx, yy);
            ok(yy, xx);
          }
          xx = arr[i];
          yy = y - wan[i];
          if (xx > 0 && yy > 0 && st.size()) {
            ok(xx, yy);
            ok(yy, xx);
          }
        }
        if (x >= wan[i] && y >= arr[i]) {
          xx = x - wan[i];
          yy = y;
          if (xx >= 0 && yy >= 0 && st.size()) {
            if (xx > 0 && yy > 0) {
              ok(xx, yy);
              ok(yy, xx);
            }
            xx = wan[i];
            yy = y - arr[i];
            if (xx > 0 && yy > 0 && st.size()) {
              ok(xx, yy);
              ok(yy, xx);
            }
          }
        }
        st.insert({arr[i], wan[i]});
      }
    }
    long long cc = x;
    x = y;
    y = cc;
    for (int i = 0; i < n; i++) {
      if (arr[i] <= x && wan[i] <= y) {
        long long xx, yy;
        xx = x - arr[i];
        yy = y;
        tmp = arr[i] * wan[i];
        st.erase(st.find({arr[i], wan[i]}));
        if (xx >= 0 && yy >= 0 && st.size()) {
          if (xx > 0 && yy > 0) {
            ok(xx, yy);
            ok(yy, xx);
          }
          xx = arr[i];
          yy = y - wan[i];
          if (xx > 0 && yy > 0 && st.size()) {
            ok(xx, yy);
            ok(yy, xx);
          }
        }
        if (x >= wan[i] && y >= arr[i]) {
          xx = x - wan[i];
          yy = y;
          if (xx >= 0 && yy >= 0 && st.size()) {
            if (xx > 0 && yy > 0) {
              ok(xx, yy);
              ok(yy, xx);
            }
            xx = wan[i];
            yy = y - arr[i];
            if (xx > 0 && yy > 0 && st.size()) {
              ok(xx, yy);
              ok(yy, xx);
            }
          }
        }
        st.insert({arr[i], wan[i]});
      }
    }
  }
  cout << ans << endl;
  return 0;
}
