#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7ll;
int n, a, b, l, r, ans;
pair<int, int> d[106];
pair<int, int> rev(int n, pair<int, int> d) {
  if (n == 0)
    return d;
  else
    return {d.second, d.first};
}
int area(int i, int j) {
  return d[i].first * d[i].second + d[j].first * d[j].second;
}
bool check(int is, int js) {
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 2; ++j) {
      pair<int, int> temp1 = rev(i, d[is]);
      pair<int, int> temp2 = rev(j, d[js]);
      if (temp1.first + temp2.first <= a &&
          max(temp2.second, temp1.second) <= b)
        return 1;
      if (max(temp2.first, temp1.first) <= a &&
          temp1.second + temp2.second <= b)
        return 1;
    }
  }
  return 0;
}
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; ++i) {
    cin >> l >> r;
    d[i] = {l, r};
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (check(i, j)) {
        ans = max(ans, area(i, j));
      }
    }
  }
  cout << ans << endl;
}
