#include <bits/stdc++.h>
const int MAXN = 200020;
long long limit[2];
long long seg[MAXN << 2][2];
void pass_up(int li, int rt) {
  seg[rt][li] = seg[rt << 1][li] + seg[rt << 1 | 1][li];
}
void update(int li, int d, long long n, int l, int r, int rt) {
  if (l == r) {
    seg[rt][li] += n;
    if (seg[rt][li] > limit[li]) {
      seg[rt][li] = limit[li];
    }
  } else {
    int mid = (l + r) >> 1;
    if (d <= mid) {
      update(li, d, n, l, mid, rt << 1);
    } else {
      update(li, d, n, mid + 1, r, rt << 1 | 1);
    }
    pass_up(li, rt);
  }
}
long long query(int li, int ll, int rr, int l, int r, int rt) {
  if ((ll <= l) && (r <= rr)) {
    return seg[rt][li];
  } else {
    int mid = (l + r) >> 1;
    long long ans = 0;
    if (ll <= mid) {
      ans += query(li, ll, rr, l, mid, rt << 1);
    }
    if (mid + 1 <= rr) {
      ans += query(li, ll, rr, mid + 1, r, rt << 1 | 1);
    }
    return ans;
  }
}
void output(int li, int l, int r, int rt) {
  printf("%d %d %d %I64d\n", l, r, rt, seg[rt][li]);
  if (l != r) {
    int mid = (l + r) >> 1;
    output(li, l, mid, rt << 1);
    output(li, mid + 1, r, rt << 1 | 1);
  }
}
int main() {
  int n, m, k, x, y;
  scanf("%d%d%d%d%d", &n, &k, &limit[1], &limit[0], &m);
  memset(seg, 0, sizeof(seg));
  for (int i = 1; i <= m; i++) {
    int type, date;
    long long num;
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d%I64d", &date, &num);
      update(0, date, num, 1, n, 1);
      update(1, date, num, 1, n, 1);
    } else {
      scanf("%d", &date);
      long long ans = 0;
      if (date - 1 >= 1) {
        ans += query(0, 1, date - 1, 1, n, 1);
      }
      if (date + k <= n) {
        ans += query(1, date + k, n, 1, n, 1);
      }
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
