#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000009;
const double EXP = 2.7182818284590452;
const double Pi = 3.1415926535;
const long double EPS = 1e-9;
const int INF = 1000 * 1000 * 1001;
const long long INFL = (long long)INF * (long long)INF;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  while (b != 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long extgcd(long long a, long long b, long long& x, long long& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x11, y11;
  long long d = extgcd(b % a, a, x11, y11);
  x = y11 - (b / a) * x11;
  y = x11;
  return d;
}
unsigned long long poww(unsigned long long v, unsigned long long p,
                        unsigned long long mod) {
  if (p == 0) return 1;
  if (p & 1) {
    return (poww(v, p - 1, mod) * v) % mod;
  } else {
    unsigned long long t = poww(v, p / 2, mod);
    return (t * t) % mod;
  }
}
const unsigned long long L31018 = 3000000000000000000L;
const unsigned long long L1018 = 1000000000000000000L;
int a, b, n, k, q, t1, t2, t3;
int a1[530005];
int a2[530005];
int step;
void set_v2(int v, int vl, int vr, int pos, int val) {
  if (vl == vr) {
    a2[v] = val;
    return;
  }
  int m = (vr + vl) / 2;
  if (pos <= m)
    set_v2(v + v, vl, m, pos, val);
  else
    set_v2(v + v + 1, m + 1, vr, pos, val);
  a2[v] = a2[v + v] + a2[v + v + 1];
}
void set_v1(int v, int vl, int vr, int pos, int val) {
  if (vl == vr) {
    a1[v] = val;
    return;
  }
  int m = (vr + vl) / 2;
  if (pos <= m)
    set_v1(v + v, vl, m, pos, val);
  else
    set_v1(v + v + 1, m + 1, vr, pos, val);
  a1[v] = a1[v + v] + a1[v + v + 1];
}
int get_sum_tr1(int v, int vl, int vr, int l, int r) {
  if (l > r) return 0;
  if (vl == l && vr == r) return a1[v];
  int m = (vr + vl) / 2;
  return get_sum_tr1(v + v, vl, m, l, ((r < m) ? (r) : (m))) +
         get_sum_tr1(v + v + 1, m + 1, vr, ((l < m + 1) ? (m + 1) : (l)), r);
}
int get_sum_tr2(int v, int vl, int vr, int l, int r) {
  if (l > r) return 0;
  if (vl == l && vr == r) return a2[v];
  int m = (vr + vl) / 2;
  return get_sum_tr2(v + v, vl, m, l, ((r < m) ? (r) : (m))) +
         get_sum_tr2(v + v + 1, m + 1, vr, ((l < m + 1) ? (m + 1) : (l)), r);
}
int get_sum1(int l, int r) { return get_sum_tr1(1, 1, step, l, r); }
int get_sum2(int l, int r) { return get_sum_tr2(1, 1, step, l, r); }
void accept() {
  cin >> n >> k >> a >> b >> q;
  step = 1;
  while (step < n) step <<= 1;
  for (int i = (0); i < (q); ++i) {
    scanf("%d%d", &t1, &t2);
    if (t1 == 1) {
      scanf("%d", &t3);
      set_v1(1, 1, step, t2,
             ((a1[t2 + step - 1] + t3 < b) ? (a1[t2 + step - 1] + t3) : (b)));
      set_v2(1, 1, step, t2,
             ((a2[t2 + step - 1] + t3 < a) ? (a2[t2 + step - 1] + t3) : (a)));
    } else {
      t1 = t2 + k;
      printf("%d\n", (get_sum1(1, t2 - 1) + get_sum2(t1, n)));
    }
  }
}
const char inputFile[] = "busy_day.in";
int main(void) {
  accept();
  return 0;
}
