#include <bits/stdc++.h>
using namespace std;
long long n, m, k, p, x2, y2, i, j, x, y, ma, ans, f, a[302], b[201];
char c[101][101], c1, c2;
string s;
int main() {
  cin >> n >> x >> y;
  for (i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (i = 1; i < n; i++) {
    for (j = i + 1; j <= n; j++) {
      if ((a[i] + a[j] <= x && max(b[i], b[j]) <= y) ||
          (a[i] + a[j] <= y && max(b[i], b[j]) <= x) ||
          (a[i] + b[j] <= x && max(b[i], a[j]) <= y) ||
          (a[i] + b[j] <= y && max(b[i], a[j]) <= x) ||
          (b[i] + a[j] <= x && max(a[i], b[j]) <= y) ||
          (b[i] + a[j] <= y && max(a[i], b[j]) <= x) ||
          (b[i] + b[j] <= x && max(a[i], a[j]) <= y) ||
          (b[i] + b[j] <= y && max(a[i], a[j]) <= x))
        ma = max(ma, a[i] * b[i] + a[j] * b[j]);
    }
  }
  cout << ma;
}
