A factory produces thimbles in bulk. Typically, it can produce up to a thimbles a day. However, some of the machinery is defective, so it can currently only produce b thimbles each day. The factory intends to choose a k-day period to do maintenance and construction; it cannot produce any thimbles during this time, but will be restored to its full production of a thimbles per day after the k days are complete.

Initially, no orders are pending. The factory receives updates of the form di, ai, indicating that ai new orders have been placed for the di-th day. Each order requires a single thimble to be produced on precisely the specified day. The factory may opt to fill as many or as few of the orders in a single batch as it likes.

As orders come in, the factory owner would like to know the maximum number of orders he will be able to fill if he starts repairs on a given day pi. Help the owner answer his questions.

Input

The first line contains five integers n, k, a, b, and q (1 ≤ k ≤ n ≤ 200 000, 1 ≤ b < a ≤ 10 000, 1 ≤ q ≤ 200 000) — the number of days, the length of the repair time, the production rates of the factory, and the number of updates, respectively.

The next q lines contain the descriptions of the queries. Each query is of one of the following two forms: 

  * 1 di ai (1 ≤ di ≤ n, 1 ≤ ai ≤ 10 000), representing an update of ai orders on day di, or 
  * 2 pi (1 ≤ pi ≤ n - k + 1), representing a question: at the moment, how many orders could be filled if the factory decided to commence repairs on day pi? 



It's guaranteed that the input will contain at least one query of the second type.

Output

For each query of the second type, print a line containing a single integer — the maximum number of orders that the factory can fill over all n days.

Examples

Input

5 2 2 1 8
1 1 2
1 5 3
1 2 1
2 2
1 4 2
1 3 2
2 1
2 3


Output

3
6
4


Input

5 4 10 1 6
1 1 5
1 5 5
1 3 2
1 5 2
2 1
2 2


Output

7
1

Note

Consider the first sample.

We produce up to 1 thimble a day currently and will produce up to 2 thimbles a day after repairs. Repairs take 2 days.

For the first question, we are able to fill 1 order on day 1, no orders on days 2 and 3 since we are repairing, no orders on day 4 since no thimbles have been ordered for that day, and 2 orders for day 5 since we are limited to our production capacity, for a total of 3 orders filled.

For the third question, we are able to fill 1 order on day 1, 1 order on day 2, and 2 orders on day 5, for a total of 4 orders.
#include <bits/stdc++.h>
template <typename T_Type, typename Function_Type,
          typename MultipleFunction_Type>
class SegmentTree {
  struct TreeNode {
    T_Type val_;
    bool has_changed_;
    TreeNode* left_;
    TreeNode* right_;
    TreeNode(T_Type val, bool has_changed = true, TreeNode* left = 0,
             TreeNode* right = 0)
        : val_(val), has_changed_(has_changed), left_(left), right_(right) {}
  };

 private:
  TreeNode* root_;
  size_t real_size_;
  Function_Type& func_;
  MultipleFunction_Type& multiple_func_;
  T_Type default_val_;
  inline T_Type GetData(TreeNode* node, size_t left, size_t right) const {
    if (node->has_changed_) {
      return multiple_func_(node->val_, right - left);
    } else {
      return node->val_;
    }
  }
  inline void Push(TreeNode* node) {
    if (node->has_changed_) {
      if (node->left_ == 0) {
        TreeNode* left = new TreeNode(node->val_, true);
        node->left_ = left;
        TreeNode* right = new TreeNode(node->val_, true);
        node->right_ = right;
      } else {
        node->left_->val_ = node->right_->val_ = node->val_;
      }
      node->has_changed_ = false;
    }
  }
  inline void Update(TreeNode* node, size_t left, size_t right) {
    size_t mid = (left + right) / 2;
    node->val_ = func_(GetData(node->left_, left, mid),
                       GetData(node->right_, mid, right));
    node->has_changed_ = false;
  }
  T_Type SetOrGetRecursive(TreeNode* node, size_t left, size_t right,
                           size_t from, size_t to, bool to_set, T_Type val) {
    if (from >= right || left >= to) {
      return default_val_;
    }
    if (left == from && right == to) {
      if (to_set) {
        node->val_ = val;
        node->has_changed_ = true;
      }
      return GetData(node, left, right);
    } else {
      Push(node);
      size_t mid = (left + right) / 2;
      T_Type left_ans = SetOrGetRecursive(node->left_, left, mid, from,
                                          std::min(to, mid), to_set, val);
      T_Type right_ans = SetOrGetRecursive(
          node->right_, mid, right, std::max(from, mid), to, to_set, val);
      Update(node, left, right);
      return func_(left_ans, right_ans);
    }
  }

 public:
  SegmentTree(size_t num, Function_Type& func,
              MultipleFunction_Type& multiple_func,
              T_Type default_val = T_Type(0))
      : root_(new TreeNode(default_val)),
        real_size_(num),
        func_(func),
        multiple_func_(multiple_func),
        default_val_(default_val) {}
  void Initialize(const std::vector<T_Type>& data) {
    for (size_t i = 0; i < data.size(); ++i) {
      Set(i, data[i]);
    }
  }
  inline void Set(size_t left, size_t right, T_Type val) {
    SetOrGetRecursive(root_, 0, real_size_, left, right, true, val);
  }
  inline void Set(size_t pos, T_Type val) { Set(pos, pos + 1, val); }
  inline const T_Type Get(size_t left, size_t right) {
    return SetOrGetRecursive(root_, 0, real_size_, left, right, false,
                             default_val_);
  }
  inline const T_Type Get(size_t pos) { return Get(pos, pos + 1); }
  inline const T_Type Get() { return Get(0, real_size_ - 1); }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, k, q, a, b;
  std::cin >> n >> k >> a >> b >> q;
  auto TwoIntsSum = [](unsigned long long lhs, unsigned long long rhs) {
    return lhs + rhs;
  };
  auto EqualIntsSum = [](unsigned long long val, size_t num) {
    return val * num;
  };
  auto tree_small =
      SegmentTree<unsigned long long, decltype(TwoIntsSum),
                  decltype(EqualIntsSum)>(n, TwoIntsSum, EqualIntsSum);
  auto tree_big =
      SegmentTree<unsigned long long, decltype(TwoIntsSum),
                  decltype(EqualIntsSum)>(n, TwoIntsSum, EqualIntsSum);
  for (size_t i = 0; i < q; i++) {
    int ty;
    std::cin >> ty;
    if (ty == 1) {
      int fi, sec;
      std::cin >> fi >> sec;
      tree_small.Set(fi - 1, std::min(tree_small.Get(fi - 1) + sec,
                                      (unsigned long long)b));
      tree_big.Set(fi - 1,
                   std::min(tree_big.Get(fi - 1) + sec, (unsigned long long)a));
    } else {
      int day;
      std::cin >> day;
      std::cout << tree_small.Get(0, day - 1) + tree_big.Get(day + k - 1, n)
                << "\n";
    }
  }
  return 0;
}
