#include <bits/stdc++.h>
using namespace std;
long long n, a, b, n2;
vector<long long> x, y;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  cin >> n >> a >> b;
  n2 = 2 * n;
  x = vector<long long>(n2);
  y = vector<long long>(n2);
  for (long long i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
    y[n + i] = x[i];
    x[n + i] = y[i];
  }
  long long res = 0;
  for (long long i = 0; i < n2; ++i) {
    for (long long j = 0; j < n2; ++j) {
      long long aux = 0;
      if (i == j or i + n == j or j + n == i or x[i] > a or x[j] > a or
          y[i] > b or y[j] > b)
        continue;
      if (x[i] + x[j] > a and y[i] + y[j] > b) continue;
      aux = x[i] * y[i] + x[j] * y[j];
      res = max(res, aux);
    }
  }
  cout << res << endl;
}
