#include <bits/stdc++.h>
bool judge(int len_a, int wid_a, int len_b, int wid_b, int a, int b) {
  int l1 = 0, l2 = 0;
  l1 = len_a + len_b;
  l2 = std::max(wid_a, wid_b);
  if (std::max(l1, l2) <= std::max(a, b) &&
      std::min(l1, l2) <= std::min(a, b)) {
    return true;
  }
  l1 = len_a + wid_b;
  l2 = std::max(wid_a, len_b);
  if (std::max(l1, l2) <= std::max(a, b) &&
      std::min(l1, l2) <= std::min(a, b)) {
    return true;
  }
  l1 = wid_a + len_b;
  l2 = std::max(len_a, wid_b);
  if (std::max(l1, l2) <= std::max(a, b) &&
      std::min(l1, l2) <= std::min(a, b)) {
    return true;
  }
  l1 = wid_a + wid_b;
  l2 = std::max(len_a, len_b);
  if (std::max(l1, l2) <= std::max(a, b) &&
      std::min(l1, l2) <= std::min(a, b)) {
    return true;
  }
  return false;
}
int main() {
  int n, a, b;
  int ans = 0;
  int len[200] = {0}, wid[200] = {0};
  std::cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    std::cin >> len[i] >> wid[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      ans = std::max(ans, judge(len[i], wid[i], len[j], wid[j], a, b) *
                              (len[i] * wid[i] + len[j] * wid[j]));
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
