#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200;
const int MOD = 1000000007;
const int INF = 1e9 + 10;
int N;
int A, B;
int X[MAXN], Y[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %d", &N, &A, &B);
  for (int i = 0; i < N; ++i) {
    scanf("%d %d", X + i, Y + i);
  }
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      if (i != j) {
        for (int r1 = 0; r1 < 2; ++r1) {
          for (int r2 = 0; r2 < 2; ++r2) {
            int w1, w2, h1, h2;
            w1 = X[i], h1 = Y[i];
            w2 = X[j], h2 = Y[j];
            if (r1) swap(w1, h1);
            if (r2) swap(w2, h2);
            if (h1 + h2 <= B && max(w1, w2) <= A) {
              ans = max(ans, w1 * h1 + w2 * h2);
            }
            if (max(h1, h2) <= B && w1 + w2 <= A) {
              ans = max(ans, w1 * h1 + w2 * h2);
            }
          }
        }
      }
    }
  }
  printf("%d", ans);
  return 0;
}
