#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, ans;
  int x[101], y[101];
  cin >> n >> a >> b;
  for (int i = 0; i < n; ++i) cin >> x[i] >> y[i];
  ans = 0;
  for (int i = 0; i < n - 1; ++i)
    for (int j = i + 1; j < n; ++j) {
      if ((x[i] + x[j] <= a && max(y[i], y[j]) <= b) ||
          (x[i] + y[j] <= a && max(y[i], x[j]) <= b) ||
          (max(x[i], x[j]) <= a && y[i] + y[j] <= b) ||
          (max(x[i], y[j]) <= a && y[i] + x[j] <= b))
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      swap(a, b);
      if ((x[i] + x[j] <= a && max(y[i], y[j]) <= b) ||
          (x[i] + y[j] <= a && max(y[i], x[j]) <= b) ||
          (max(x[i], x[j]) <= a && y[i] + y[j] <= b) ||
          (max(x[i], y[j]) <= a && y[i] + x[j] <= b))
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
    }
  cout << ans;
  return 0;
}
