#include <bits/stdc++.h>
using namespace std;
long long int v[110][2];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int n;
  cin >> n;
  long long int a, b;
  cin >> a >> b;
  for (long long int i = 1; i <= n; i++) {
    long long int x, y;
    cin >> x >> y;
    v[i][0] = x;
    v[i][1] = y;
  }
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = i + 1; j <= n; j++) {
      long long int area = v[i][0] * v[i][1] + v[j][0] * v[j][1];
      for (long long int k = 1; k <= 4; k++) {
        if (v[i][0] + v[j][0] <= a && v[i][1] <= b && v[j][1] <= b) {
          ans = max(ans, area);
        }
        if (v[i][0] <= a && v[j][0] <= a && v[i][1] + v[j][1] <= b) {
          ans = max(ans, area);
        }
        swap(v[j][0], v[j][1]);
        if (k % 2 == 1) {
          swap(v[i][0], v[i][1]);
        }
      }
    }
  }
  cout << ans << '\n';
}
