#include<bits/stdc++.h>
using namespace std;
using lld = long long;
const lld P = 1e9+696969;
const lld Q = 7;
int solve(vector<pair<int,int> >& t, int X){
for(auto& i : t)
if(i.first > i.second)
swap(i.first,i.second);
vector<pair<int,lld> > e;
e.reserve(2*t.size()+2);
lld q=1;
for(int i=0;i<t.size();i++){
e.push_back({t[i].first, q});
e.push_back({t[i].second, P-q});
q = (q*Q) % P;
}
e.push_back({0,0});
e.push_back({X,0});
sort(e.begin(), e.end());
vector<pair<lld,int> > p;
p.reserve(2*t.size()+1);
lld l=e[0].second;
for(int i=1;i<e.size();i++){
p.push_back({l,e[i].first-e[i-1].first});
l += e[i].second;
l %= P;
}
sort(p.begin(), p.end());
int res = 0;
int sum = 0;
lld val = -1;
for(auto& i : p){
if(i.first != val){
sum = 0;
val = i.first;
}
sum += i.second;
res = max(res, sum);
}
return res;
}
int main(void){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,X,Y;
cin >> n >> X >> Y;
vector<pair<int,int> > a(n), b(n);
for(int i=0;i<n;i++)
cin >> a[i].first >> b[i].first >> a[i].second >> b[i].second;
int x = solve(a,X);
int y = solve(b,Y);
cout << (lld) x * (lld) y << "\n";
return 0;
}