#include <bits/stdc++.h>
using namespace std;
int a, b;
int n;
struct node {
  int x, y;
} code[210];
int mianji(int s, int t) { return s * t; }
int cal() {
  int i, j;
  int x1, y1;
  int x2, y2;
  int x3, y3;
  int x4, y4;
  int maxn = 0;
  for (i = 1; i <= n; i++) {
    x1 = code[i].x;
    y1 = code[i].y;
    for (j = i + 1; j <= n; ++j) {
      int flag = 1;
      x2 = code[j].x;
      y2 = code[j].y;
      if (x1 <= a && y1 <= b) {
        x3 = a - x1;
        y3 = b;
        x4 = b - y1;
        y4 = a;
        if (x2 <= x3 && y2 <= y3 || x2 <= x4 && y2 <= y4 ||
            x2 <= y3 && y2 <= x3 || x2 <= y4 && y2 <= x4) {
          maxn = max(maxn, mianji(x1, y1) + mianji(x2, y2));
          flag = 0;
        }
      }
      if (flag) {
        if (x1 <= b && y1 <= a) {
          x3 = a - y1;
          y3 = b;
          x4 = b - x1;
          y4 = a;
          if (x2 <= x3 && y2 <= y3 || x2 <= x4 && y2 <= y4 ||
              x2 <= y3 && y2 <= x3 || x2 <= y4 && y2 <= x4) {
            maxn = max(maxn, mianji(x1, y1) + mianji(x2, y2));
            flag = 0;
          }
        }
      }
    }
  }
  return maxn;
}
int main() {
  int i, j, k;
  while (~scanf("%d", &n)) {
    scanf("%d%d", &a, &b);
    if (a > b) {
      a ^= b;
      b ^= a;
      a ^= b;
    }
    int x, y;
    for (i = 1; i <= n; i++) {
      scanf("%d%d", &x, &y);
      if (x > y) {
        x ^= y;
        y ^= x;
        x ^= y;
      }
      code[i].x = x;
      code[i].y = y;
    }
    printf("%d\n", cal());
  }
  return 0;
}
