#include <bits/stdc++.h>
using namespace std;
int n, a, b, m, i, x[110][3], y[110][3], k1, k2, j, sol;
int main() {
  cin >> n >> a >> b;
  for (i = 1; i <= n; i++) {
    cin >> x[i][1] >> y[i][1];
    y[i][2] = x[i][1];
    x[i][2] = y[i][1];
  }
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) {
      for (k1 = 1; k1 <= 2; k1++)
        for (k2 = 1; k2 <= 2; k2++) {
          if (x[i][k1] + x[j][k2] <= a && max(y[i][k1], y[j][k2]) <= b)
            sol = max(sol, x[i][k1] * y[i][k1] + y[j][k2] * x[j][k2]);
          if (max(x[i][k1], x[j][k2]) <= a && y[i][k1] + y[j][k2] <= b)
            sol = max(sol, x[i][k1] * y[i][k1] + y[j][k2] * x[j][k2]);
        }
    }
  cout << sol;
  return 0;
}
