#include <bits/stdc++.h>
using namespace std;
const int maxn = 200002;
int n, k, a, b, q;
inline int lo(int x) { return x & -x; }
struct bit {
  int nums[maxn] = {0};
  void up(int pos, int val) {
    while (pos <= n) {
      nums[pos] += val;
      pos += lo(pos);
    }
  }
  int qu(int pos) {
    int ret = 0;
    while (pos != 0) {
      ret += nums[pos];
      pos -= lo(pos);
    }
    return ret;
  }
} b1, b2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int x, y, z;
    cin >> x;
    if (x == 1) {
      cin >> y >> z;
      int tmp = b1.qu(y) - b1.qu(y - 1);
      if (tmp + z < b)
        b1.up(y, z);
      else if (tmp < b)
        b1.up(y, b - tmp);
      tmp = b2.qu(y) - b2.qu(y - 1);
      if (tmp + z < a)
        b2.up(y, z);
      else if (tmp < a)
        b2.up(y, a - tmp);
    } else {
      cin >> y;
      cout << b2.qu(n) - b2.qu(y + k - 1) + b1.qu(y - 1) << "\n";
    }
  }
  return 0;
}
