#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define endl '\n'
//#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
const ll INF = 2e18;
const ll DIM = 200007;
const ld PI = 3.1415926535;
const int mod = 998244353;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifdef IloveCP
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int h, w, n, x;
cin >> h >> w >> n >> x;
int l0 = w + 1, r0 = 0, u0 = h + 1, d0 = 0;
for(int i = 0; i < n; i++) {
int u, d, l, r, c;
cin >> u >> d >> l >> r >> c;
l0 = min(l0, l); r0 = max(r0, r);
u0 = min(u0, u); d0 = max(d0, d);
cout << ll(r0 - l0 + 1) * ll(d0 - u0 + 1) << endl;
}
return 0;
}