#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  int m[101][2];
  for (int i = 0; i < n; i++) cin >> m[i][0] >> m[i][1];
  int ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int s = m[i][0] * m[i][1] + m[j][0] * m[j][1];
      int a1, b1;
      a1 = m[i][0] + m[j][0];
      b1 = max(m[i][1], m[j][1]);
      if (a1 <= a && b1 <= b || a1 <= b && b1 <= a) {
        ans = max(ans, s);
        continue;
      }
      a1 = m[i][0] + m[j][1];
      b1 = max(m[i][1], m[j][0]);
      if (a1 <= a && b1 <= b || a1 <= b && b1 <= a) {
        ans = max(ans, s);
        continue;
      }
      a1 = m[i][1] + m[j][0];
      b1 = max(m[i][0], m[j][1]);
      if (a1 <= a && b1 <= b || a1 <= b && b1 <= a) {
        ans = max(ans, s);
        continue;
      }
      a1 = m[i][1] + m[j][1];
      b1 = max(m[i][0], m[j][0]);
      if (a1 <= a && b1 <= b || a1 <= b && b1 <= a) {
        ans = max(ans, s);
        continue;
      }
    }
  cout << ans;
  return 0;
}
