#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define INPUT freopen("draft.inp","r",stdin)
#define OUTPUT freopen("draft.out","w",stdout)
#define FOR(i,l,r) for(auto i=l;i<=r;i++)
#define REP(i,l,r) for(auto i=l;i<r;i++)
#define FORD(i,l,r) for(auto i=l;i>=r;i--)
#define REPD(i,l,r) for(auto i=l;i>r;i--)
#define ENDL printf("\n")
#define debug 1
typedef long long ll;
typedef pair<int,int> ii;
const int inf=1e9;
const int MOD=1e9+7;
const double PI=3.14159265359;
const int N=1e5+10;
template <class T> bool minimize(T &x,T y){
if (x>y) x=y;else return 0;
return 1;
}
template <class T> bool maximize(T &x,T y){
if (x<y) x=y;else return 0;
return 1;
}
ll S[N<<2],sum[N<<2][2];
int laz[N<<2][2],c[N<<2];
ii h[N<<2][2],ma[N<<2][2],mi[N<<2][2];
int n,m,a[N][2],gold[2],q[N][4];
void lazyupdate(int node,int L,int R){
if (!c[node]) return;
FOR(type,0,1) if (h[node][type].Y){
ma[node][type].X=mi[node][type].X=h[node][type].X;
sum[node][type]=1LL*h[node][type].X*c[node];
S[node]=1LL*h[node][type].X*sum[node][type^1];
if (L<R){
h[node*2][type]=h[node*2+1][type]=h[node][type];
laz[node*2][type]=laz[node*2+1][type]=0;
}
h[node][type]=ii(0,0);
}
S[node]+=sum[node][1]*laz[node][0]+sum[node][0]*laz[node][1]+1LL*laz[node][0]*laz[node][1]*c[node];
FOR(i,0,1) if (laz[node][i]){
sum[node][i]+=1LL*laz[node][i]*c[node];
ma[node][i].X+=laz[node][i];
mi[node][i].X+=laz[node][i];
if (L<R){
laz[node*2][i]+=laz[node][i];
laz[node*2+1][i]+=laz[node][i];
}
laz[node][i]=0;
}
}
void getinfo(int node){
FOR(type,0,1){
mi[node][type]=(mi[node<<1][type].X<mi[node*2+1][type].X)?mi[node*2][type]:mi[node*2+1][type];
ma[node][type]=(ma[node<<1][type].X>ma[node*2+1][type].X)?ma[node*2][type]:ma[node*2+1][type];
sum[node][type]=(sum[node<<1][type]+sum[node*2+1][type]);
}
c[node]=c[node*2]+c[node*2+1];
S[node]=S[node*2]+S[node*2+1];
}
void update(int type,int node,int L,int R,int l,int r,int v){
lazyupdate(node,L,R);
if (L>r||R<l) return;
if (l<=L&&R<=r){
if (type>2) laz[node][type-3]+=v;
else h[node][type-1]=ii(v,1);
lazyupdate(node,L,R);
return;
}
update(type,node*2,L,(L+R)/2,l,r,v);
update(type,node*2+1,(L+R)/2+1,R,l,r,v);
getinfo(node);
}
ll query(int type,int node,int L,int R,int l,int r){
lazyupdate(node,L,R);
if (L>r||R<l) return 0;
if (l<=L&&R<=r) return (type?c[node]:S[node]);
return query(type,node*2,L,(L+R)/2,l,r)+query(type,node*2+1,(L+R)/2+1,R,l,r);
}
void clearnode(int node){
FOR(i,0,1){
mi[node][i].X=inf;
ma[node][i].X=-inf;
h[node][i]=ii(0,0);
laz[node][i]=0;
sum[node][i]=0;
}
c[node]=S[node]=0;
}
void erase(int node,int L,int R,int x){
lazyupdate(node,L,R);
if (L>x||R<x) return;
if (L==R){
clearnode(node);
return;
}
erase(node*2,L,(L+R)/2,x);
erase(node*2+1,(L+R)/2+1,R,x);
getinfo(node);
}
void build(int node,int L,int R){
if (L==R){
bool ok=!(a[L][0]>gold[0]||a[L][1]>gold[1]||a[L][0]<=0||a[L][1]<=0);
FOR(i,0,1){
mi[node][i]=ii(ok?a[L][i]:inf,L);
ma[node][i]=ii(ok?a[L][i]:-inf,L);
sum[node][i]=ok?a[L][i]:0;
}
c[node]=ok;
S[node]=ok?1LL*a[L][0]*a[L][1]:0;
return;
}
build(node*2,L,(L+R)/2);
build(node*2+1,(L+R)/2+1,R);
getinfo(node);
}
void detect(){
FOR(type,0,1){
while (ma[1][type].X>gold[type]){
int x=ma[1][type].Y;
erase(1,1,n,x);
}
while (mi[1][type].X<=0){
int x=mi[1][type].Y;
erase(1,1,n,x);
}
}
}
void check(int node,int L,int R){
printf("%d %d %d\n",node,L,R);
// printf("Max a:%d %d\n",ma[node][0].X,ma[node][0].Y);
// printf("Min a:%d %d\n",mi[node][0].X,mi[node][0].Y);
// printf("Max b:%d %d\n",ma[node][1].X,ma[node][1].Y);
// printf("Min b:%d %d\n",mi[node][1].X,mi[node][1].Y);
printf("%d %d\n",laz[node][0],laz[node][1]);
cout<<sum[node][0]<<" "<<sum[node][1]<<'\n'<<S[node]<<'\n';
if (L==R) return;
check(node*2,L,(L+R)/2);
check(node*2+1,(L+R)/2+1,R);
}
int main(){
freopen("vmellip.inp", "r", stdin);
freopen("vmellip.out", "w", stdout);
// INPUT;OUTPUT;
scanf("%d%d",&n,&m);
FOR(i,1,n)
FOR(j,0,1) scanf("%d",a[i]+j);
FOR(i,1,m) {
FOR(j,0,2) scanf("%d",q[i]+j);
if (q[i][0]<=4) scanf("%d",q[i]+3);
}
scanf("%d%d",gold,gold+1);
build(1,1,n);
// check(1,1,n);
FOR(i,1,m){
// printf("%d...\n",i);
if (q[i][0]<=4) update(q[i][0],1,1,n,q[i][1],q[i][2],q[i][3]);
else {
detect();
printf("%lld\n",query(q[i][0]-5,1,1,n,q[i][1],q[i][2]));
}
// check(1,1,n);
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAojZGVmaW5lIFggZmlyc3QKI2RlZmluZSBZIHNlY29uZAojZGVmaW5lIElOUFVUIGZyZW9wZW4oImRyYWZ0LmlucCIsInIiLHN0ZGluKQojZGVmaW5lIE9VVFBVVCBmcmVvcGVuKCJkcmFmdC5vdXQiLCJ3IixzdGRvdXQpCiNkZWZpbmUgRk9SKGksbCxyKSBmb3IoYXV0byBpPWw7aTw9cjtpKyspCiNkZWZpbmUgUkVQKGksbCxyKSBmb3IoYXV0byBpPWw7aTxyO2krKykKI2RlZmluZSBGT1JEKGksbCxyKSBmb3IoYXV0byBpPWw7aT49cjtpLS0pCiNkZWZpbmUgUkVQRChpLGwscikgZm9yKGF1dG8gaT1sO2k+cjtpLS0pCiNkZWZ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dHlwZV09aFtub2RlXVt0eXBlXTsKICAgICAgICAgICAgbGF6W25vZGUqMl1bdHlwZV09bGF6W25vZGUqMisxXVt0eXBlXT0wOwogICAgICAgIH0KICAgICAgICBoW25vZGVdW3R5cGVdPWlpKDAsMCk7CiAgICB9CiAgICBTW25vZGVdKz1zdW1bbm9kZV1bMV0qbGF6W25vZGVdWzBdK3N1bVtub2RlXVswXSpsYXpbbm9kZV1bMV0rMUxMKmxheltub2RlXVswXSpsYXpbbm9kZV1bMV0qY1tub2RlXTsKICAgIEZPUihpLDAsMSkgaWYgKGxheltub2RlXVtpXSl7CiAgICAgICAgc3VtW25vZGVdW2ldKz0xTEwqbGF6W25vZGVdW2ldKmNbbm9kZV07CiAgICAgICAgbWFbbm9kZV1baV0uWCs9bGF6W25vZGVdW2ldOwogICAgICAgIG1pW25vZGVdW2ldLlgrPWxheltub2RlXVtpXTsKICAgICAgICBpZiAoTDxSKXsKICAgICAgICAgICAgbGF6W25vZGUqMl1baV0rPWxheltub2RlXVtpXTsKICAgICAgICAgICAgbGF6W25vZGUqMisxXVtpXSs9bGF6W25vZGVdW2ldOwogICAgICAgIH0KICAgICAgICBsYXpbbm9kZV1baV09MDsKICAgIH0KfQp2b2lkIGdldGluZm8oaW50IG5vZGUpewogICAgRk9SKHR5cGUsMCwxKXsKICAgICAgICBtaVtub2RlXVt0eXBlXT0obWlbbm9kZTw8MV1bdHlwZV0uWDxtaVtub2RlKjIrMV1bdHlwZV0uWCk/bWlbbm9kZSoyXVt0eXBlXTptaVtub2RlKjIrMV1bdHlwZV07CiAgICAgICAgbWFbbm9kZV1bdHlwZV09KG1hW25vZGU8PDFdW3R5cGVdLlg+bWFbbm9kZSoyKzFdW3R5cGVdLlgpP21hW25vZGUqMl1bdHlwZV06bWFbbm9kZSoyKzFdW3R5cGVdOwogICAgICAgIHN1bVtub2RlXVt0eXBlXT0oc3VtW25vZGU8PDFdW3R5cGVdK3N1bVtub2RlKjIrMV1bdHlwZV0pOwogICAgfQogICAgY1tub2RlXT1jW25vZGUqMl0rY1tub2RlKjIrMV07CiAgICBTW25vZGVdPVNbbm9kZSoyXStTW25vZGUqMisxXTsKfQp2b2lkIHVwZGF0ZShpbnQgdHlwZSxpbnQgbm9kZSxpbnQgTCxpbnQgUixpbnQgbCxpbnQgcixpbnQgdil7CiAgICBsYXp5dXBkYXRlKG5vZGUsTCxSKTsKICAgIGlmIChMPnJ8fFI8bCkgcmV0dXJuOwogICAgaWYgKGw8PUwmJlI8PXIpewogICAgICAgIGlmICh0eXBlPjIpIGxheltub2RlXVt0eXBlLTNdKz12OwogICAgICAgIGVsc2UgaFtub2RlXVt0eXBlLTFdPWlpKHYsMSk7CiAgICAgICAgbGF6eXVwZGF0ZShub2RlLEwsUik7CiAgICAgICAgcmV0dXJuOwogICAgfQogICAgdXBkYXRlKHR5cGUsbm9kZSoyLEwsKEwrUikvMixsLHIsdik7CiAgICB1cGRhdGUodHlwZSxub2RlKjIrMSwoTCtSKS8yKzEsUixsLHIsdik7CiAgICBnZXRpbmZvKG5vZGUpOwp9CmxsIHF1ZXJ5KGludCB0eXBlLGludCBub2RlLGludCBMLGludCBSLGludCBsLGludCByKXsKICAgIGxhenl1cGRhdGUobm9kZSxMLFIpOwogICAgaWYgKEw+cnx8UjxsKSByZXR1cm4gMDsKICAgIGlmIChsPD1MJiZSPD1yKSByZXR1cm4gKHR5cGU/Y1tub2RlXTpTW25vZGVdKTsKICAgIHJldHVybiBxdWVyeSh0eXBlLG5vZGUqMixMLChMK1IpLzIsbCxyKStxdWVyeSh0eXBlLG5vZGUqMisxLChMK1IpLzIrMSxSLGwscik7Cn0Kdm9pZCBjbGVhcm5vZGUoaW50IG5vZGUpewogICAgRk9SKGksMCwxKXsKICAgICAgICBtaVtub2RlXVtpXS5YPWluZjsKICAgICAgICBtYVtub2RlXVtpXS5YPS1pbmY7CiAgICAgICAgaFtub2RlXVtpXT1paSgwLDApOwogICAgICAgIGxheltub2RlXVtpXT0wOwogICAgICAgIHN1bVtub2RlXVtpXT0wOwogICAgfQogICAgY1tub2RlXT1TW25vZGVdPTA7Cn0Kdm9pZCBlcmFzZShpbnQgbm9kZSxpbnQgTCxpbnQgUixpbnQgeCl7CiAgICBsYXp5dXBkYXRlKG5vZGUsTCxSKTsKICAgIGlmIChMPnh8fFI8eCkgcmV0dXJuOwogICAgaWYgKEw9PVIpewogICAgICAgIGNsZWFybm9kZShub2RlKTsKICAgICAgICByZXR1cm47CiAgICB9CiAgICBlcmFzZShub2RlKjIsTCwoTCtSKS8yLHgpOwogICAgZXJhc2Uobm9kZSoyKzEsKEwrUikvMisxLFIseCk7CiAgICBnZXRpbmZvKG5vZGUpOwp9CnZvaWQgYnVpbGQoaW50IG5vZGUsaW50IEwsaW50IFIpewogICAgaWYgKEw9PVIpewogICAgICAgIGJvb2wgb2s9IShhW0xdWzBdPmdvbGRbMF18fGFbTF1bMV0+Z29sZFsxXXx8YVtMXVswXTw9MHx8YVtMXVsxXTw9MCk7CiAgICAgICAgRk9SKGksMCwxKXsKICAgICAgICAgICAgbWlbbm9kZV1baV09aWkob2s/YVtMXVtpXTppbmYsTCk7CiAgICAgICAgICAgIG1hW25vZGVdW2ldPWlpKG9rP2FbTF1baV06LWluZixMKTsKICAgICAgICAgICAgc3VtW25vZGVdW2ldPW9rP2FbTF1baV06MDsKICAgICAgICB9CiAgICAgICAgY1tub2RlXT1vazsKICAgICAgICBTW25vZGVdPW9rPzFMTCphW0xdWzBdKmFbTF1bMV06MDsKICAgICAgICByZXR1cm47CiAgICB9CiAgICBidWlsZChub2RlKjIsTCwoTCtSKS8yKTsKICAgIGJ1aWxkKG5vZGUqMisxLChMK1IpLzIrMSxSKTsKICAgIGdldGluZm8obm9kZSk7Cn0Kdm9pZCBkZXRlY3QoKXsKICAgIEZPUih0eXBlLDAsMSl7CiAgICAgICAgd2hpbGUgKG1hWzFdW3R5cGVdLlg+Z29sZFt0eXBlXSl7CiAgICAgICAgICAgIGludCB4PW1hWzFdW3R5cGVdLlk7CiAgICAgICAgICAgIGVyYXNlKDEsMSxuLHgpOwogICAgICAgIH0KICAgICAgICB3aGlsZSAobWlbMV1bdHlwZV0uWDw9MCl7CiAgICAgICAgICAgIGludCB4PW1pWzFdW3R5cGVdLlk7CiAgICAgICAgICAgIGVyYXNlKDEsMSxuLHgpOwogICAgICAgIH0KICAgIH0KfQp2b2lkIGNoZWNrKGludCBub2RlLGludCBMLGludCBSKXsKICAgIHByaW50ZigiJWQgJWQgJWRcbiIsbm9kZSxMLFIpOwovLyAgICBwcmludGYoIk1heCBhOiVkICVkXG4iLG1hW25vZGVdWzBdLlgsbWFbbm9kZV1bMF0uWSk7Ci8vICAgIHByaW50ZigiTWluIGE6JWQgJWRcbiIsbWlbbm9kZV1bMF0uWCxtaVtub2RlXVswXS5ZKTsKLy8gICAgcHJpbnRmKCJNYXggYjolZCAlZFxuIixtYVtub2RlXVsxXS5YLG1hW25vZGVdWzFdLlkpOwovLyAgICBwcmludGYoIk1pbiBiOiVkICVkXG4iLG1pW25vZGVdWzFdLlgsbWlbbm9kZV1bMV0uWSk7CiAgICBwcmludGYoIiVkICVkXG4iLGxheltub2RlXVswXSxsYXpbbm9kZV1bMV0pOwogICAgY291dDw8c3VtW25vZGVdWzBdPDwiICI8PHN1bVtub2RlXVsxXTw8J1xuJzw8U1tub2RlXTw8J1xuJzsKICAgIGlmIChMPT1SKSByZXR1cm47CiAgICBjaGVjayhub2RlKjIsTCwoTCtSKS8yKTsKICAgIGNoZWNrKG5vZGUqMisxLChMK1IpLzIrMSxSKTsKfQppbnQgbWFpbigpewoJZnJlb3Blbigidm1lbGxpcC5pbnAiLCAiciIsIHN0ZGluKTsKCWZyZW9wZW4oInZtZWxsaXAub3V0IiwgInciLCBzdGRvdXQpOwovLyAgICBJTlBVVDtPVVRQVVQ7CiAgICBzY2FuZigiJWQlZCIsJm4sJm0pOwogICAgRk9SKGksMSxuKQogICAgICAgIEZPUihqLDAsMSkgc2NhbmYoIiVkIixhW2ldK2opOwogICAgRk9SKGksMSxtKSB7CiAgICAgICAgRk9SKGosMCwyKSBzY2FuZigiJWQiLHFbaV0raik7CiAgICAgICAgaWYgKHFbaV1bMF08PTQpIHNjYW5mKCIlZCIscVtpXSszKTsKICAgIH0KICAgIHNjYW5mKCIlZCVkIixnb2xkLGdvbGQrMSk7CiAgICBidWlsZCgxLDEsbik7Ci8vICAgIGNoZWNrKDEsMSxuKTsKICAgIEZPUihpLDEsbSl7Ci8vICAgICAgICBwcmludGYoIiVkLi4uXG4iLGkpOwogICAgICAgIGlmIChxW2ldWzBdPD00KSB1cGRhdGUocVtpXVswXSwxLDEsbixxW2ldWzFdLHFbaV1bMl0scVtpXVszXSk7CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRldGVjdCgpOwogICAgICAgICAgICBwcmludGYoIiVsbGRcbiIscXVlcnkocVtpXVswXS01LDEsMSxuLHFbaV1bMV0scVtpXVsyXSkpOwogICAgICAgIH0KLy8gICAgICAgIGNoZWNrKDEsMSxuKTsKICAgIH0KfQ==