#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int BITLEFT[MAXN], BITRIGHT[MAXN];
int arrayLeft[MAXN], arrayRight[MAXN];
int n, k, a, b, q;
void updLeft(int pos, int val) {
  while (pos <= n) {
    BITLEFT[pos] += val;
    pos += pos & -pos;
  }
}
int getLeft(int pos) {
  int ret = 0;
  while (pos) {
    ret += BITLEFT[pos];
    pos -= pos & -pos;
  }
  return ret;
}
void updRight(int pos, int val) {
  while (pos <= n) {
    BITRIGHT[pos] += val;
    pos += pos & -pos;
  }
}
int getRight(int pos) {
  int ret = 0;
  while (pos) {
    ret += BITRIGHT[pos];
    pos -= pos & -pos;
  }
  return ret;
}
int main() {
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  while (q--) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int day, val;
      scanf("%d%d", &day, &val);
      int prevVal = arrayLeft[day];
      arrayLeft[day] += val;
      arrayLeft[day] = min(arrayLeft[day], b);
      updLeft(day, arrayLeft[day] - prevVal);
      prevVal = arrayRight[day];
      arrayRight[day] += val;
      arrayRight[day] = min(arrayRight[day], a);
      updRight(day, arrayRight[day] - prevVal);
    } else {
      int day;
      scanf("%d", &day);
      int ans = getLeft(day - 1) + getRight(n) - getRight(min(n, day + k - 1));
      printf("%d\n", ans);
    }
  }
  return 0;
}
