#include <bits/stdc++.h>
using namespace std;
int len[105], wid[105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int a, b, n, fans = 0;
  cin >> n >> a >> b;
  for (long long i = 1; i <= n; i++) cin >> len[i] >> wid[i];
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) {
      int ans = (len[i] * wid[i]) + (len[j] * wid[j]);
      int a1 = max(len[i], wid[i]);
      int b1 = min(len[i], wid[i]);
      int a2 = max(len[j], wid[j]);
      int b2 = min(len[j], wid[j]);
      if (a1 + a2 <= a && max(b1, b2) <= b) fans = max(fans, ans);
      if (b1 + b2 <= a && max(a1, a2) <= b) fans = max(fans, ans);
      if (b1 + a2 <= a && max(a1, b2) <= b) fans = max(fans, ans);
      if (a1 + b2 <= a && max(b1, a2) <= b) fans = max(fans, ans);
      if (a1 + a2 <= b && max(b1, b2) <= a) fans = max(fans, ans);
      if (b1 + b2 <= b && max(a1, a2) <= a) fans = max(fans, ans);
      if (b1 + a2 <= b && max(a1, b2) <= a) fans = max(fans, ans);
      if (a1 + b2 <= b && max(b1, a2) <= a) fans = max(fans, ans);
    }
  }
  cout << fans << endl;
}
