#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
template <class T>
bool scanff(T &ret) {
  char c;
  int sgn;
  T bit = 0.1;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && c != '.' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  if (c == ' ' || c == '\n') {
    ret *= sgn;
    return 1;
  }
  while (c = getchar(), c >= '0' && c <= '9') ret += (c - '0') * bit, bit /= 10;
  ret *= sgn;
  return 1;
}
using namespace std;
long long c[2][200200];
long long val[200200];
long long n, k, a, b, q;
void add(int x, long long val, int idx) {
  for (int i = x; i <= n; i += (i & (-i))) c[idx][i] += val;
}
long long getsum(int x, int idx) {
  long long sum = 0;
  while (x) {
    sum += c[idx][x];
    x -= (x & (-x));
  }
  return sum;
}
int main() {
  scanff(n);
  scanff(k);
  scanff(a);
  scanff(b);
  scanff(q);
  for (int i = int(1); i <= int(q); i++) {
    long long op, x, y;
    scanff(op);
    if (op == 1) {
      scanff(x);
      scanff(y);
      add(x, -min(b, val[x]), 0);
      add(x, -min(a, val[x]), 1);
      val[x] += y;
      add(x, min(b, val[x]), 0);
      add(x, min(a, val[x]), 1);
    } else {
      scanff(x);
      long long ans = getsum(x - 1, 0);
      ans += getsum(n, 1) - getsum(x + k - 1, 1);
      printf("%lld\n", ans);
    }
  }
  return 0;
}
