#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;
const ull p[] = {
(ull)1e9 + 7,
(ull)1e9 + 607,
(ull)1e9 + 1927
};
struct event { bool start; int x, index; };
bool operator< (const event& a, const event& b) {
return a.x < b.x;
}
int max_common_len(vector<pii>& spans, int bound) {
int n = spans.size();
vector<event> coords(2*n);
for (int i = 0; i < n; i++) {
coords[2*i] = { true, spans[i].first, i };
coords[2*i+1] = { false, spans[i].second, i };
}
sort(coords.begin(), coords.end());
typedef pair<ull, ull> hkey;
vector<hkey> pp(n);
pp[0] = { 1, 1 };
for (int i = 1; i < n; i++) {
pp[i].first = p[0] * pp[i-1].first;
pp[i].second = p[1] * pp[i-1].second;
}
map<hkey, int> areas;
hkey h = { 0, 0 };
int prev_x = 0;
for (event c : coords) {
if (c.x != prev_x) {
if (areas.count(h) == 0) {
areas[h] = 0;
}
areas[h] += c.x - prev_x;
}
h.first += (c.start ? 1 : -1) * pp[c.index].first;
h.second += (c.start ? 1 : -1) * pp[c.index].second;
prev_x = c.x;
}
if (bound != prev_x) {
if (areas.count(h) == 0) {
areas[h] = 0;
}
areas[h] += bound - prev_x;
}
int max_area = 0;
for (auto a : areas) max_area = max(max_area, a.second);
return max_area;
}
int main() {
ios_base::sync_with_stdio(0);
int n, w, h;
cin >> n >> w >> h;
vector<pii> xs(n), ys(n);
for (int i = 0; i < n; i++) {
cin >> xs[i].first >> ys[i].first >> xs[i].second >> ys[i].second;
if (xs[i].first > xs[i].second) swap(xs[i].first, xs[i].second);
if (ys[i].first > ys[i].second) swap(ys[i].first, ys[i].second);
}
ll rx = max_common_len(xs, w);
ll ry = max_common_len(ys, h);
cout << rx * ry << endl;
return 0;
}