#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, a, b;
  cin >> n >> a >> b;
  vector<long long int> x(n);
  vector<long long int> y(n);
  for (long long int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      if ((x[i] + x[j] <= a && y[i] <= b && y[j] <= b) ||
          (x[i] + y[j] <= a && y[i] <= b && x[j] <= b) ||
          (y[i] + y[j] <= a && x[i] <= b && x[j] <= b) ||
          (y[i] + x[j] <= a && x[i] <= b && y[j] <= b)) {
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      }
    }
  }
  long long int tmp = b;
  b = a;
  a = tmp;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      if ((x[i] + x[j] <= a && y[i] <= b && y[j] <= b) ||
          (x[i] + y[j] <= a && y[i] <= b && x[j] <= b) ||
          (y[i] + y[j] <= a && x[i] <= b && x[j] <= b) ||
          (y[i] + x[j] <= a && x[i] <= b && y[j] <= b)) {
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
