#include <bits/stdc++.h>
using namespace std;
int n, k, a, b;
vector<int> aa, bb;
void up_a(int v, int tl, int tr, int pos, int add) {
  if (tl == tr) {
    aa[v] = min(aa[v] + add, a);
  } else {
    int tm = (tl + tr) >> 1;
    if (pos <= tm) {
      up_a(2 * v + 1, tl, tm, pos, add);
    } else {
      up_a(2 * v + 2, tm + 1, tr, pos, add);
    }
    aa[v] = aa[2 * v + 1] + aa[2 * v + 2];
  }
}
int get_a(int v, int tl, int tr, int l, int r) {
  if (l > r) {
    return 0;
  }
  if (l == tl && r == tr) {
    return aa[v];
  } else {
    int tm = (tl + tr) >> 1;
    return get_a(2 * v + 1, tl, tm, l, min(tm, r)) +
           get_a(2 * v + 2, tm + 1, tr, max(tm + 1, l), r);
  }
}
void up_b(int v, int tl, int tr, int pos, int add) {
  if (tl == tr) {
    bb[v] = min(bb[v] + add, b);
  } else {
    int tm = (tl + tr) >> 1;
    if (pos <= tm) {
      up_b(2 * v + 1, tl, tm, pos, add);
    } else {
      up_b(2 * v + 2, tm + 1, tr, pos, add);
    }
    bb[v] = bb[2 * v + 1] + bb[2 * v + 2];
  }
}
int get_b(int v, int tl, int tr, int l, int r) {
  if (l > r) {
    return 0;
  }
  if (l == tl && r == tr) {
    return bb[v];
  } else {
    int tm = (tl + tr) >> 1;
    return get_b(2 * v + 1, tl, tm, l, min(r, tm)) +
           get_b(2 * v + 2, tm + 1, tr, max(tm + 1, l), r);
  }
}
int main(int argc, char *argv[]) {
  int q;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  k--;
  aa.resize(4 * n, 0);
  bb.resize(4 * n, 0);
  while (q--) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int d, w;
      scanf("%d%d", &d, &w);
      d--;
      up_a(0, 0, n - 1, d, w);
      up_b(0, 0, n - 1, d, w);
    } else {
      int w;
      scanf("%d", &w);
      w--;
      printf("%d\n", get_b(0, 0, n - 1, 0, w - 1) +
                         get_a(0, 0, n - 1, w + k + 1, n - 1));
    }
  }
  return 0;
}
