#include <iostream>
using namespace std;
typedef long long ll;
ll p[200005];
ll p2[200005];
ll c[200005];
ll c2[200005];
ll n;
ll a, b, k;
inline ll lowbit(ll x)
{
return x & (-x);
}
void update(ll x, ll y)
{
while(x <= n)
{
c[x] += y;
x += lowbit(x);
}
return;
}
void update2(ll x, ll y)
{
while(x <= n)
{
c2[x] += y;
x += lowbit(x);
}
return;
}
ll query(ll x)
{
ll tmp = 0;
while(x > 0)
{
tmp += c[x];
x -= lowbit(x);
}
return tmp;
}
ll query2(ll x)
{
ll tmp = 0;
while(x > 0)
{
tmp += c2[x];
x -= lowbit(x);
}
return tmp;
}
int main()
{
cin >> n >> k >> a >> b;
ll q;
cin >> q;
while(q --)
{
ll oper;
cin >> oper;
if(oper == 1)
{
ll x, y;
cin >> x >> y;
if(p[x] + y > b)
{
update(x, b - p[x]);
p[x] += y;
}
else
{
p[x] += y;
update(x, y);
}
if(p2[x] + y > a)
{
update2(x, a - p2[x]);
p2[x] += y;
}
else
{
p2[x] += y;
update2(x, y);
}
}
if(oper == 2)
{
ll x;
cin >> x;
cout << query(x - 1) + query2(n) - query2(x + k - 1) << endl;
}
}
return 0;
}