#include <bits/stdc++.h>
using namespace std;
const int modulo = 444444;
const int maxN = modulo * 8;
long long rsq1[maxN], rsq2[maxN], n, k, a, b, q;
void replace1(long long i, long long x) {
  i += modulo - 1;
  rsq1[i] = min(rsq1[i] + x, a);
  i /= 2;
  while (i > 0) {
    rsq1[i] = rsq1[i + i] + rsq1[i + i + 1];
    i /= 2;
  }
}
void replace2(long long i, long long x) {
  i += modulo - 1;
  rsq2[i] = min(rsq2[i] + x, b);
  i /= 2;
  while (i > 0) {
    rsq2[i] = rsq2[i + i] + rsq2[i + i + 1];
    i /= 2;
  }
}
long long getsum1(long long l, long long r) {
  long long ans = 0;
  long long i = l + modulo - 1, j = r + modulo - 1;
  while (i <= j) {
    if (i % 2 == 1) ans += rsq1[i];
    if (j % 2 == 0) ans += rsq1[j];
    i = (i + 1) / 2;
    j = (j - 1) / 2;
  }
  return ans;
}
long long getsum2(long long l, long long r) {
  long long ans = 0;
  long long i = l + modulo - 1, j = r + modulo - 1;
  while (i <= j) {
    if (i % 2 == 1) ans += rsq2[i];
    if (j % 2 == 0) ans += rsq2[j];
    i = (i + 1) / 2;
    j = (j - 1) / 2;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> a >> b >> q;
  for (int i = 1; i <= q; ++i) {
    int type;
    cin >> type;
    if (type == 1) {
      long long x, y;
      cin >> x >> y;
      replace1(x, y);
      replace2(x, y);
    } else {
      long long num;
      cin >> num;
      long long L = num, R = num + k - 1;
      long long answer = getsum2(1, L - 1) + getsum1(R + 1, n);
      cout << answer << endl;
    }
  }
  return 0;
}
