//Marcin Knapik, Potyczki Algorytmiczne, Dzień 3, zadanie "Terytoria"[B]
//złożoność O(n log n)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define all(s) s.begin(), s.end()
#define sz(s) (int)s.size()
#define ull unsigned ll
#define FOR(i, z) for(int i = 0; i < z; i++)
#define losuj(a, b) uniform_int_distribution<ull>(a, b)(rng)
ll n, X, Y;
const unsigned ll MAX_LL = 0xFFFFFFFFFFFFFFFF;
mt19937 rng(51);
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> X >> Y;
vector<pair<ll, ull>> tab[2];
tab[0].pb({X, 0});
tab[1].pb({Y, 0});
for(int i = 0; i < n ; i++){
int a, b, c, d;
cin >> a >> b >> c >> d;
if(a > c)
swap(a, c);
if(b > d)
swap(b, d);
ull id = losuj(1, MAX_LL);
tab[0].pb({a, id});
tab[0].pb({c, id});
tab[1].pb({b, id});
tab[1].pb({d, id});
}
FOR(i, 2)
sort(all(tab[i]));
map<ull, ll> mapa[2];
ll maxi[2] = {0, 0};
ll poz[2] = {0, 0};
FOR(i, 2){
ull hasz = 0;
for(auto&u:tab[i]){
if(!mapa[i].count(hasz))
mapa[i][hasz] = u.f - poz[i];
else
mapa[i][hasz] += u.f - poz[i];
poz[i] = u.f;
maxi[i] = max(maxi[i], mapa[i][hasz]);
hasz = hasz^u.s;
}
}
cout << maxi[0] * maxi[1] << '\n';
}