#include <bits/stdc++.h>
using namespace std;
int n, a, b;
pair<int, int> p[105];
int main() {
  cin >> n >> a >> b;
  int x, y;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    p[i].first = max(x, y);
    p[i].second = min(x, y);
  }
  int ans = 0;
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (p[i].first <= a && p[j].first <= a &&
          p[i].second + p[j].second <= b) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
      if (p[i].first <= b && p[j].first <= b &&
          p[i].second + p[j].second <= a) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
      if (p[i].second <= a && p[j].second <= a &&
          p[i].first + p[j].first <= b) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
      if (p[i].second <= b && p[j].second <= b &&
          p[i].first + p[j].first <= a) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
      if (p[i].first <= a && p[j].second <= a &&
          p[i].second + p[j].first <= b) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
      if (p[i].first <= b && p[j].second <= b &&
          p[i].second + p[j].first <= a) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
      if (p[j].first <= a && p[i].second <= a &&
          p[j].second + p[i].first <= b) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
      if (p[j].first <= b && p[i].second <= b &&
          p[j].second + p[i].first <= a) {
        ans = max(ans, p[i].first * p[i].second + p[j].first * p[j].second);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
