#include <bits/stdc++.h>
using namespace std;
struct Rect {
  int a, b;
  Rect(int aa, int bb) : a(aa), b(bb) {}
  Rect() : Rect(0, 0) {}
  bool into(const Rect& other) { return a <= other.a && b <= other.b; }
  int area() const { return a * b; }
  void read() { cin >> a >> b; }
  Rect turn() const { return Rect(b, a); }
};
int n;
Rect field, rects[102];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  field.read();
  for (int i = 0; i < n; ++i) {
    rects[i].read();
  }
  int result = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      for (int m = 0; m < 4; ++m) {
        Rect x = ((m & 1) ? rects[i] : rects[i].turn());
        Rect y = ((m & 2) ? rects[j] : rects[j].turn());
        if (!x.into(field) || !y.into(field)) {
          continue;
        }
        if (y.into(Rect(field.a - x.a, field.b)) ||
            y.into(Rect(field.a, field.b - x.b))) {
          result = max(result, x.area() + y.area());
        }
      }
    }
  }
  cout << result;
  return 0;
}
