#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
int main() {
  int n, a, b, ans = 0;
  cin >> n >> a >> b;
  vector<pair<int, int>> A(n);
  for (int i = 0; i < n; i++) cin >> A[i].first >> A[i].second;
  for (int i = 0; i < n - 1; i++)
    for (int u = i + 1; u < n; u++)
      if ((A[i].first + A[u].first <= a && A[i].second <= b &&
           A[u].second <= b) ||
          (A[i].second + A[u].second <= a && A[i].first <= b &&
           A[u].first <= b) ||
          (A[i].first + A[u].first <= b && A[i].second <= a &&
           A[u].second <= a) ||
          (A[i].second + A[u].second <= b && A[i].first <= a &&
           A[u].first <= a) ||
          (A[i].first + A[u].second <= a && A[i].second <= b &&
           A[u].first <= b) ||
          (A[i].first + A[u].second <= b && A[i].second <= a &&
           A[u].first <= a) ||
          (A[i].second + A[u].first <= a && A[i].first <= b &&
           A[u].second <= b) ||
          (A[i].second + A[u].first <= b && A[i].first <= a &&
           A[u].second <= a))
        ans = max(ans, A[i].first * A[i].second + A[u].first * A[u].second);
  cout << ans;
  return 0;
}
