#include <bits/stdc++.h>
using namespace std;
void sc(int& a) { scanf("%d", &a); }
void sc(long long int& a) { scanf("%lld", &a); }
void sc(int& a, int& b) {
  sc(a);
  sc(b);
}
void sc(long long int& a, long long int& b) {
  sc(a);
  sc(b);
}
void sc(int& a, int& b, int& c) {
  sc(a, b);
  sc(c);
}
void sc(long long int& a, long long int& b, long long int& c) {
  sc(a, b);
  sc(c);
}
void prl(int a) { printf("%d\n", a); }
void prl(long long int a) { printf("%lld\n", a); }
void prl() { printf("\n"); }
void prs(int a) { printf("%d ", a); }
void prs(long long int a) { printf("%lld ", a); }
void prl(long long int a, long long int b) {
  cout << a << " " << b << " " << endl;
}
void prl(long long int a, long long int b, long long int c) {
  cout << a << " " << b << " " << c << " " << endl;
}
void prl(long long int a, long long int b, long long int c, long long int d) {
  cout << a << " " << b << " " << c << " " << d << endl;
}
void prl(long long int a, long long int b, long long int c, long long int d,
         long long int e) {
  cout << a << " " << b << " " << c << " " << d << " " << e << endl;
}
void prl(long long int a, long long int b, long long int c, long long int d,
         long long int e, long long int f) {
  cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
}
int mod = 1000000007;
long long int modpow(long long int a, long long int b, long long int mod) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b = b / 2;
  }
  return res % mod;
}
int taken1[200000 + 5], taken2[200000 + 5];
int cumtree1[4 * 200000 + 5], cumtree2[4 * 200000 + 5];
void update1(int node, int start, int end, int idx, int val) {
  if (start > end || start > idx || end < idx) return;
  if (start == end) {
    cumtree1[node] += val;
  } else {
    int mid = (start + end) / 2;
    if (start <= idx and idx <= mid)
      update1(2 * node, start, mid, idx, val);
    else
      update1(2 * node + 1, mid + 1, end, idx, val);
    cumtree1[node] = cumtree1[2 * node] + cumtree1[2 * node + 1];
  }
}
void update2(int node, int start, int end, int idx, int val) {
  if (start > end || start > idx || end < idx) return;
  if (start == end) {
    cumtree2[node] += val;
  } else {
    int mid = (start + end) / 2;
    if (start <= idx and idx <= mid)
      update2(2 * node, start, mid, idx, val);
    else
      update2(2 * node + 1, mid + 1, end, idx, val);
    cumtree2[node] = cumtree2[2 * node] + cumtree2[2 * node + 1];
  }
}
int query1(int node, int start, int end, int l, int r) {
  if (r < start or end < l or r < l) return 0;
  if (l <= start and end <= r) return cumtree1[node];
  int mid = (start + end) / 2;
  int p1 = query1(2 * node, start, mid, l, r);
  int p2 = query1(2 * node + 1, mid + 1, end, l, r);
  return (p1 + p2);
}
int query2(int node, int start, int end, int l, int r) {
  if (r < start or end < l or r < l) return 0;
  if (l <= start and end <= r) return cumtree2[node];
  int mid = (start + end) / 2;
  int p1 = query2(2 * node, start, mid, l, r);
  int p2 = query2(2 * node + 1, mid + 1, end, l, r);
  return (p1 + p2);
}
int main() {
  int n, k, a, b, q, x, day, z, query;
  sc(n, k, a);
  sc(b, q);
  while (q--) {
    sc(x);
    if (x == 1) {
      sc(day, z);
      if (taken1[day] < b) {
        int taken = min(b - taken1[day], z);
        update1(1, 1, n, day, taken);
        taken1[day] += taken;
      }
      if (taken2[day] < a) {
        int taken = min(a - taken2[day], z);
        update2(1, 1, n, day, taken);
        taken2[day] += taken;
      }
    } else {
      sc(query);
      int ans = query1(1, 1, n, 1, query - 1);
      ans += query2(1, 1, n, query + k, n);
      prl(ans);
    }
  }
}
