#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
int n, X, Y;
vector <pair <int, LL> > xs, ys;
long long getLL(long long a = LLONG_MIN, long long b = LLONG_MAX){
static mt19937_64 rng(2496820);
return uniform_int_distribution <long long int> (a, b)(rng);
}
LL solve(vector <pair <int, LL> > in, int C){
sort(in.begin(), in.end());
in.push_back({C, 0});
map <LL, int> M;
int last = 0; LL pref = 0;
for(auto v: in){
M[pref] += v.first - last;
last = v.first;
pref ^= v.second;
}
int ans = 0;
for(auto v: M)
ans = max(ans, v.second);
return ans;
}
int main(){
scanf("%d %d %d", &n, &X, &Y);
for(int i = 1; i <= n; ++i){
int x1, y1, x2, y2;
scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
if(x1 > x2) swap(x1, x2);
if(y1 > y2) swap(y1, y2);
LL xrand = getLL(0, LLONG_MAX);
LL yrand = getLL(0, LLONG_MAX);
xs.push_back({x1, xrand});
xs.push_back({x2, xrand});
ys.push_back({y1, yrand});
ys.push_back({y2, yrand});
}
printf("%lld\n", 1LL * solve(xs, X) * solve(ys, Y));
return 0;
}