#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int ans;
struct Node {
  int x, y;
} node[110];
int main() {
  while (~scanf("%d%d%d", &n, &a, &b)) {
    ans = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &node[i].x, &node[i].y);
    }
    for (int i = 0; i < n; i++)
      for (int j = i + 1; j < n; j++) {
        if (node[i].x + node[j].x <= a || node[i].y + node[j].y <= b) {
          if (max(node[i].x, node[j].x) <= a && max(node[i].y, node[j].y) <= b)
            ans = max(ans, node[i].x * node[i].y + node[j].x * node[j].y);
        }
        if (node[i].x + node[j].y <= a || node[i].y + node[j].x <= b) {
          if (max(node[i].x, node[j].y) <= a && max(node[i].y, node[j].x) <= b)
            ans = max(ans, node[i].x * node[i].y + node[j].x * node[j].y);
        }
        if (node[i].x + node[j].x <= b || node[i].y + node[j].y <= a) {
          if (max(node[i].x, node[j].x) <= b && max(node[i].y, node[j].y) <= a)
            ans = max(ans, node[i].x * node[i].y + node[j].x * node[j].y);
        }
        if (node[i].x + node[j].y <= b || node[i].y + node[j].x <= a) {
          if (max(node[i].x, node[j].y) <= b && max(node[i].y, node[j].x) <= a)
            ans = max(ans, node[i].x * node[i].y + node[j].x * node[j].y);
        }
      }
    cout << ans << endl;
  }
  return 0;
}
