#include <bits/stdc++.h>
using namespace std;
const int N = 110;
pair<int, int> sz[N];
bool cmp(const pair<int, int>& A, const pair<int, int>& B) {
  return A.first * A.second > B.first * B.second;
}
int main(void) {
  int n, m, a, b;
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) cin >> sz[i].first >> sz[i].second;
  sort(sz + 1, sz + 1 + n, cmp);
  int res = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      int x1 = sz[i].first, y1 = sz[i].second, x2 = sz[j].first,
          y2 = sz[j].second;
      int flag = 0;
      if (x1 + x2 <= a && max(y1, y2) <= b)
        flag = 1;
      else if (x1 + y2 <= a && max(y1, x2) <= b)
        flag = 1;
      else if (y1 + x2 <= a && max(x1, y2) <= b)
        flag = 1;
      else if (y1 + y2 <= a && max(x1, x2) <= b)
        flag = 1;
      else if (x1 + x2 <= b && max(y1, y2) <= a)
        flag = 1;
      else if (x1 + y2 <= b && max(y1, x2) <= a)
        flag = 1;
      else if (y1 + x2 <= b && max(x1, y2) <= a)
        flag = 1;
      else if (y1 + y2 <= b && max(x1, x2) <= a)
        flag = 1;
      if (flag) {
        res = sz[i].first * sz[i].second + sz[j].first * sz[j].second;
        ans = max(ans, res);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
