#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
void arquivo() {
  freopen("", "r", stdin);
  freopen("", "w", stdout);
}
const int N = 200200;
int n, k, a, b, q;
pair<long long, long long> tr[4 * N];
long long vet[N];
pair<long long, long long> join(pair<long long, long long> a,
                                pair<long long, long long> b) {
  return pair<long long, long long>(a.first + b.first, a.second + b.second);
}
void update(int no, int l, int r, int i, long long val) {
  if (l == r) {
    vet[i] += val;
    tr[no] = pair<long long, long long>(min((long long)a, vet[i]),
                                        min((long long)b, vet[i]));
    return;
  }
  int nxt = (no << 1), mid = (l + r) >> 1;
  if (i <= mid)
    update(nxt, l, mid, i, val);
  else
    update(nxt + 1, mid + 1, r, i, val);
  tr[no] = join(tr[nxt], tr[nxt + 1]);
}
pair<long long, long long> query(int no, int l, int r, int i, int j) {
  if (r < i || l > j) return pair<long long, long long>(0, 0);
  if (l >= i && r <= j) return tr[no];
  int nxt = (no << 1), mid = (l + r) >> 1;
  return join(query(nxt, l, mid, i, j), query(nxt + 1, mid + 1, r, i, j));
}
void upd(int x, long long v) {
  x--;
  update(1, 0, n - 1, x, v);
}
long long que(int p) {
  p--;
  int l = p, r = p + k - 1;
  long long p1 = query(1, 0, n - 1, 0, l - 1).second;
  long long p2 = query(1, 0, n - 1, r + 1, n - 1).first;
  return p1 + p2;
}
int main() {
  scanf("%d %d %d %d %d", &n, &k, &a, &b, &q);
  while (q--) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int a, b;
      scanf("%d %d", &a, &b);
      upd(a, b);
    } else {
      int x;
      scanf("%d", &x);
      printf("%lld\n", que(x));
    }
  }
  return 0;
}
