#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 50;
const int INF = 1 << 30;
pair<int, int> a[105];
int main() {
  int n, a1, b1;
  scanf("%d%d%d", &n, &a1, &b1);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
  int maxn = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i].first + a[j].first <= a1 &&
          max(a[i].second, a[j].second) <= b1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
      if (a[i].first + a[j].second <= a1 &&
          max(a[i].second, a[j].first) <= b1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
      if (a[i].second + a[j].second <= a1 &&
          max(a[i].first, a[j].first) <= b1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
      if (a[i].second + a[j].first <= a1 &&
          max(a[i].first, a[j].second) <= b1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
      if (a[i].first + a[j].first <= b1 &&
          max(a[i].second, a[j].second) <= a1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
      if (a[i].first + a[j].second <= b1 &&
          max(a[i].second, a[j].first) <= a1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
      if (a[i].second + a[j].second <= b1 &&
          max(a[i].first, a[j].first) <= a1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
      if (a[i].second + a[j].first <= b1 &&
          max(a[i].first, a[j].second) <= a1) {
        maxn = max(maxn, a[i].first * a[i].second + a[j].first * a[j].second);
      }
    }
  }
  printf("%d\n", maxn);
  return 0;
}
