#include <bits/stdc++.h>
using namespace std;
template <typename T>
T expo(T e, T n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T power(T e, T n, T m) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = (x * p) % m;
    p = (p * p) % m;
    n >>= 1;
  }
  return x;
}
template <typename T>
T InverseEuler(T a, T m) {
  return (a == 1 ? 1 : power(a, m - 2, m));
}
template <typename T>
T gcd(T a, T b) {
  while (a %= b ^= a ^= b ^= a)
    ;
  return b;
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
double tick() {
  static clock_t oldtick;
  clock_t newtick = clock();
  double diff = 1.0 * (newtick - oldtick) / CLOCKS_PER_SEC;
  oldtick = newtick;
  return diff;
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int MAX = 200001;
long long tree[2][4 * MAX];
int n, k, q;
long long a, b;
void update(int start, int endd, int node, int index, int val, int x) {
  if (start == endd) {
    if (x == 0) {
      tree[x][node] += val;
      tree[x][node] = min(tree[x][node], a);
    } else {
      tree[x][node] += val;
      tree[x][node] = min(tree[x][node], b);
    }
    return;
  }
  int mid = (start + endd) / 2;
  if (index >= start && index <= mid) {
    update(start, mid, node * 2, index, val, x);
  } else {
    update(mid + 1, endd, node * 2 + 1, index, val, x);
  }
  tree[x][node] = tree[x][node * 2] + tree[x][node * 2 + 1];
}
long long query(int node, int s, int e, int l, int r, int x) {
  if (r < s || l > e) return 0;
  if (s >= l && e <= r) return tree[x][node];
  int mid = (s + e) / 2;
  if (r <= mid)
    return query(node * 2, s, mid, l, r, x);
  else if (l > mid)
    return query(node * 2 + 1, mid + 1, e, l, r, x);
  return query(node * 2, s, mid, l, r, x) +
         query(node * 2 + 1, mid + 1, e, l, r, x);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> a >> b >> q;
  for (__typeof(q) i = 1; i <= q; ++i) {
    int type;
    cin >> type;
    if (type == 1) {
      int index, val;
      cin >> index >> val;
      update(1, n, 1, index, val, 0);
      update(1, n, 1, index, val, 1);
    } else {
      int p;
      cin >> p;
      cout << query(1, 1, n, 1, p - 1, 1) + query(1, 1, n, p + k, n, 0) << endl;
    }
  }
  return 0;
}
