#include <bits/stdc++.h>
using namespace std;
const long long N = 100 + 2, inf = 1e18;
long long n, a, b;
long long x[N], y[N];
long long ans;
bool canFit(long long xa, long long ya, long long x, long long y) {
  return (x <= xa && y <= ya) || (y <= xa && x <= ya);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> a >> b;
  for (long long i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++)
      if (i != j) {
        long long len = x[i], brd = y[i];
        if (a >= len && b >= brd) {
          bool yes =
              canFit(a - len, b, x[j], y[j]) or canFit(a, b - brd, x[j], y[j]);
          if (yes) ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
        swap(len, brd);
        if (a >= len && b >= brd) {
          bool yes =
              canFit(a - len, b, x[j], y[j]) or canFit(a, b - brd, x[j], y[j]);
          if (yes) ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
      }
  cout << ans;
}
