#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cstdio>

using namespace std;

int n,w,h,r,q,a,b,x,y;
double v[100005];

int main()
{
    cin>>w>>h>>r>>g;
    memset(v,h,sizeof(v));
    for(int i=1;i<=n;i++)
    {
        cin>>a;
        if(a==2)
        {
            cin>>b;
            cout<<v[b]<<endl
        }
        else if(a==1)
        {
            cin>>x>>y;
            v[x]--;
        }
    }
}