#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000, MAXM = 100000;
int n, m;
int a[MAXN + 9], b[MAXN + 9];
int tp[MAXM + 9], l[MAXM + 9], r[MAXM + 9], v[MAXM + 9];
int A, B;
int main()
{
ifstream cin("vmellip.inp");
ofstream cout("vmellip.ans");
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> m;
for(int i = 1; i <= n; i++)
{
cin >> a[i] >> b[i];
}
for(int i = 1; i <= m; i++)
{
cin >> tp[i];
if(tp[i] <= 4)
{
cin >> l[i] >> r[i] >> v[i];
}
else
{
cin >> l[i] >> r[i];
}
}
cin >> A >> B;
for(int i = 1; i <= m; i++)
{
if(tp[i] == 1)
{
for(int j = l[i]; j <= r[i]; j++)
{
if(a[j] > 0 && a[j] <= A)
{
a[j] = v[i];
}
}
}
else if(tp[i] == 2)
{
for(int j = l[i]; j <= r[i]; j++)
{
if(b[j] > 0 && b[j] <= B)
{
b[j] = v[i];
}
}
}
else if(tp[i] == 3)
{
for(int j = l[i]; j <= r[i]; j++)
{
if(a[j] > 0 && a[j] <= A)
{
a[j] += v[i];
}
}
}
else if(tp[i] == 4)
{
for(int j = l[i]; j <= r[i]; j++)
{
if(b[j] > 0 && b[j] <= B)
{
b[j] += v[i];
}
}
}
else if(tp[i] == 5)
{
long long ans = 0;
for(int j = l[i]; j <= r[i]; j++)
{
if(a[j] > 0 && a[j] <= A && b[j] > 0 && b[j] <= B)
{
ans += (long long)a[j] * b[j];
}
}
cout << ans << "\n";
}
else
{
int ans = 0;
for(int j = l[i]; j <= r[i]; j++)
{
if(a[j] > 0 && a[j] <= A && b[j] > 0 && b[j] <= B)
{
ans++;
}
}
cout << ans << "\n";
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmNvbnN0IGludCBNQVhOID0gMTAwMDAwLCBNQVhNID0gMTAwMDAwOwppbnQgbiwgbTsKaW50IGFbTUFYTiArIDldLCBiW01BWE4gKyA5XTsKaW50IHRwW01BWE0gKyA5XSwgbFtNQVhNICsgOV0sIHJbTUFYTSArIDldLCB2W01BWE0gKyA5XTsKaW50IEEsIEI7CgppbnQgbWFpbigpCnsKICAgIGlmc3RyZWFtIGNpbigidm1lbGxpcC5pbnAiKTsKICAgIG9mc3RyZWFtIGNvdXQoInZtZWxsaXAuYW5zIik7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUoTlVMTCk7CiAgICBjaW4gPj4gbiA+PiBtOwogICAgZm9yKGludCBpID0gMTsgaSA8PSBuOyBpKyspCiAgICB7CiAgICAgICAgY2luID4+IGFbaV0gPj4gYltpXTsKICAgIH0KICAgIGZvcihpbnQgaSA9IDE7IGkgPD0gbTsgaSsrKQogICAgewogICAgICAgIGNpbiA+PiB0cFtpXTsKICAgICAgICBpZih0cFtpXSA8PSA0KQogICAgICAgIHsKICAgICAgICAgICAgY2luID4+IGxbaV0gPj4gcltpXSA+PiB2W2ldOwogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBjaW4gPj4gbFtpXSA+PiByW2ldOwogICAgICAgIH0KICAgIH0KICAgIGNpbiA+PiBBID4+IEI7CiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG07IGkrKykKICAgIHsKICAgICAgICBpZih0cFtpXSA9PSAxKQogICAgICAgIHsKICAgICAgICAgICAgZm9yKGludCBqID0gbFtpXTsgaiA8PSByW2ldOyBqKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmKGFbal0gPiAwICYmIGFbal0gPD0gQSkKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBhW2pdID0gdltpXTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBlbHNlIGlmKHRwW2ldID09IDIpCiAgICAgICAgewogICAgICAgICAgICBmb3IoaW50IGogPSBsW2ldOyBqIDw9IHJbaV07IGorKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaWYoYltqXSA+IDAgJiYgYltqXSA8PSBCKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIGJbal0gPSB2W2ldOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYodHBbaV0gPT0gMykKICAgICAgICB7CiAgICAgICAgICAgIGZvcihpbnQgaiA9IGxbaV07IGogPD0gcltpXTsgaisrKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpZihhW2pdID4gMCAmJiBhW2pdIDw9IEEpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgYVtqXSArPSB2W2ldOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYodHBbaV0gPT0gNCkKICAgICAgICB7CiAgICAgICAgICAgIGZvcihpbnQgaiA9IGxbaV07IGogPD0gcltpXTsgaisrKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpZihiW2pdID4gMCAmJiBiW2pdIDw9IEIpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgYltqXSArPSB2W2ldOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYodHBbaV0gPT0gNSkKICAgICAgICB7CiAgICAgICAgICAgIGxvbmcgbG9uZyBhbnMgPSAwOwogICAgICAgICAgICBmb3IoaW50IGogPSBsW2ldOyBqIDw9IHJbaV07IGorKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaWYoYVtqXSA+IDAgJiYgYVtqXSA8PSBBICYmIGJbal0gPiAwICYmIGJbal0gPD0gQikKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBhbnMgKz0gKGxvbmcgbG9uZylhW2pdICogYltqXTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBjb3V0IDw8IGFucyA8PCAiXG4iOwogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBpbnQgYW5zID0gMDsKICAgICAgICAgICAgZm9yKGludCBqID0gbFtpXTsgaiA8PSByW2ldOyBqKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmKGFbal0gPiAwICYmIGFbal0gPD0gQSAmJiBiW2pdID4gMCAmJiBiW2pdIDw9IEIpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgYW5zKys7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgY291dCA8PCBhbnMgPDwgIlxuIjsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gMDsKfQo=