#include <bits/stdc++.h>   using namespace std;   const int MaxN = int(2e5) + 256;   const int INF = int(1e9);   const int mod = (int)(1e9) + 7;   const double pi = 3.1415926535897932384626433832795;   long long n, m, ans, A[MaxN], k, a, b, q;   long long t[MaxN * 8], t1[MaxN * 8];   void upd(int v, int l, int r, int pos, int val) {     if (l == r) {       t[v] += val;       t1[v] += val;       t[v] = min(a, t[v]);       t1[v] = min(t1[v], b);       return;     }     int m = (l + r) / 2;     if (pos <= m) {       upd(v + v, l, m, pos, val);     } else       upd(v + v + 1, m + 1, r, pos, val);     t[v] = t[v + v] + t[v + v + 1];     t1[v] = t1[v + v] + t1[v + v + 1];   }   long long get(int v, int l, int r, int tl, int tr) {     if (l > tr || r < tl) return 0;     if (tl <= l & r <= tr) return t[v];     int m = (l + r) / 2;     return get(v + v, l, m, tl, tr) + get(v + v + 1, m + 1, r, tl, tr);   }   long long get1(int v, int l, int r, int tl, int tr) {     if (l > tr || r < tl) return 0;     if (tl <= l & r <= tr) return t1[v];     int m = (l + r) / 2;     return get1(v + v, l, m, tl, tr) + get1(v + v + 1, m + 1, r, tl, tr);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cin >> n >> k >> a >> b >> q;     while (q--) {       int type;       cin >> type;       if (type == 1) {         int x, y;         cin >> x >> y;         upd(1, 1, n, x, y);       } else {         int p;         cin >> p;         int S = 0;         if (p > 1) {           S = get1(1, 1, n, 1, p - 1);         }         int S1 = 0;         if (p + k <= n) {           S1 = get(1, 1, n, p + k, n);         }         cout << S + S1 <<   n ;       }     }     return 0;   }   