#include <bits/stdc++.h>
using namespace std;
long long c[200001];
long long n, k, a1, b1, q;
class minTree {
  long long a, b;
  long long maxSum;
  long long minSum;
  minTree* left;
  minTree* right;

 public:
  minTree(long long a, long long b) {
    this->a = a;
    this->b = b;
    if (a != b) {
      left = new minTree(a, (a + b) / 2);
      right = new minTree((a + b) / 2 + 1, b);
      minSum = left->getMin(a, (a + b) / 2) + right->getMin((a + b) / 2 + 1, b);
      maxSum = left->getMax(a, (a + b) / 2) + right->getMax((a + b) / 2 + 1, b);
    } else {
      minSum = 0;
      maxSum = 0;
    }
  }
  long long getMin(long long l, long long r) {
    if (a > r || b < l)
      return 0;
    else if (a >= l && b <= r) {
      return minSum;
    } else if (a <= l && r <= (a + b) / 2) {
      return left->getMin(l, r);
    } else if (l > (a + b) / 2 && r <= b) {
      return right->getMin(l, r);
    } else {
      return left->getMin(l, r) + right->getMin(l, r);
    }
  }
  long long getMax(long long l, long long r) {
    if (a > r || b < l)
      return 0;
    else if (a >= l && b <= r) {
      return maxSum;
    } else if (a <= l && r <= (a + b) / 2) {
      return left->getMax(l, r);
    } else if (l > (a + b) / 2 && r <= b) {
      return right->getMax(l, r);
    } else {
      return left->getMax(l, r) + right->getMax(l, r);
    }
  }
  void setValue(long long v, long long pos) {
    if (a == b && a == pos) {
      minSum = min(b1, minSum + v);
      maxSum = min(a1, maxSum + v);
    } else {
      if (a <= pos && pos <= (a + b) / 2) {
        left->setValue(v, pos);
      } else if ((a + b) / 2 < pos && pos <= b) {
        right->setValue(v, pos);
      }
      minSum = left->getMin(a, (a + b) / 2) + right->getMin((a + b) / 2 + 1, b);
      maxSum = left->getMax(a, (a + b) / 2) + right->getMax((a + b) / 2 + 1, b);
    }
  }
};
int main() {
  cin >> n >> k >> a1 >> b1 >> q;
  minTree* m = new minTree(1, n);
  for (int i = 1; i <= q; i++) {
    int t1, t2, t3;
    cin >> t1;
    if (t1 == 1) {
      cin >> t2 >> t3;
      m->setValue(t3, t2);
    } else {
      cin >> t2;
      cout << m->getMin(1, t2 - 1) + m->getMax(t2 + k, n) << endl;
    }
  }
  return 0;
}
