#include <bits/stdc++.h>
using namespace std;
int x[110], y[110];
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  if (a > b) swap(a, b);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    if (x[i] > y[i]) swap(x[i], y[i]);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (x[i] <= a && y[i] <= b) {
        if (x[j] <= a - x[i] && y[j] <= b) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
        if (x[j] <= b && y[j] <= a - x[i]) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
        if (x[j] <= a && y[j] <= b - y[i]) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
        if (x[j] <= b - y[i] && y[j] <= a) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
      }
      if (x[i] <= b && y[i] <= a) {
        if (x[j] <= a - y[i] && y[j] <= b) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
        if (x[j] <= b && y[j] <= a - y[i]) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
        if (x[j] <= a && y[j] <= b - x[i]) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
        if (x[j] <= b - x[i] && y[j] <= a) {
          ans = max(ans, x[i] * y[i] + x[j] * y[j]);
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
