#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;
}
