#include <bits/stdc++.h>
using namespace std;
const int Z = (int)3e3 + 111;
const int N = (int)3e5 + 111;
const int INF = (int)1e9 + 111;
const int MOD = (int)1e9 + 7;
int x[111], y[111];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a, b;
  cin >> n >> a >> b;
  int ans = 0;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      if (x[i] + x[j] <= a && max(y[i], y[j]) <= b)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      if (x[i] + x[j] <= b && max(y[i], y[j]) <= a)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      if (x[i] + y[j] <= a && max(x[j], y[i]) <= b)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      if (x[i] + y[j] <= b && max(x[j], y[i]) <= a)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      if (y[i] + x[j] <= a && max(x[i], y[j]) <= b)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      if (y[i] + x[j] <= b && max(x[i], y[j]) <= a)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      if (y[i] + y[j] <= a && max(x[i], x[j]) <= b)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
      if (y[i] + y[j] <= b && max(x[i], x[j]) <= a)
        ans = max(ans, x[i] * y[i] + x[j] * y[j]);
    }
  cout << ans;
  return 0;
}
