Problem: Fedya and Sasha are friends, that's why Sasha knows everything about Fedya.

Fedya keeps his patience in an infinitely large bowl. But, unlike the bowl, Fedya's patience isn't infinite, that is why let v be the number of liters of Fedya's patience, and, as soon as v becomes equal to 0, the bowl will burst immediately. There is one tap in the bowl which pumps s liters of patience per second. Notice that s can be negative, in that case, the tap pumps out the patience. Sasha can do different things, so he is able to change the tap's speed. All actions that Sasha does can be represented as q queries. There are three types of queries:

  1. "1 t s" — add a new event, means that starting from the t-th second the tap's speed will be equal to s. 
  2. "2 t" — delete the event which happens at the t-th second. It is guaranteed that such event exists. 
  3. "3 l r v" — Sasha wonders: if you take all the events for which l ≤ t ≤ r and simulate changes of Fedya's patience from the very beginning of the l-th second till the very beginning of the r-th second inclusive (the initial volume of patience, at the beginning of the l-th second, equals to v liters) then when will be the moment when the bowl will burst. If that does not happen, then the answer will be -1. 



Since Sasha does not want to check what will happen when Fedya's patience ends, and he has already come up with the queries, he is asking you to help him and find the answer for each query of the 3-rd type.

It is guaranteed that at any moment of time, there won't be two events which happen at the same second.

Input

The first line contans one integer q (1 ≤ q ≤ 10^5) — the number of queries.

Each of the next q lines have one of the following formats:

  * 1 t s (1 ≤ t ≤ 10^9, -10^9 ≤ s ≤ 10^9), means that a new event is added, which means that starting from the t-th second the tap's speed will be equal to s. 
  * 2 t (1 ≤ t ≤ 10^9), means that the event which happens at the t-th second must be deleted. Guaranteed that such exists. 
  * 3 l r v (1 ≤ l ≤ r ≤ 10^9, 0 ≤ v ≤ 10^9), means that you should simulate the process from the very beginning of the l-th second till the very beginning of the r-th second inclusive, and to say when will the bowl burst. 



It is guaranteed that t, s, l, r, v in all the queries are integers.

Also, it is guaranteed that there is at least one query of the 3-rd type, and there won't be a query of the 1-st type with such t, that there already exists an event which happens at that second t.

Output

For each query of the 3-rd type, print in a new line the moment when the bowl will burst or print -1 if it won't happen.

Your answer will be considered correct if it's absolute or relative error does not exceed 10^{-6}.

Formally, let your answer be a, and the jury's answer be b. Your answer is accepted if and only if \frac{|a - b|}{max{(1, |b|)}} ≤ 10^{-6}.

Examples

Input


6
1 2 1
1 4 -3
3 1 6 1
3 1 6 3
3 1 6 4
3 1 6 5


Output


5
5.666667
6
-1


Input


10
1 2 2
1 4 4
1 7 -10
3 2 4 1
3 5 6 0
3 1 15 1
2 4
3 1 15 1
1 8 1
3 1 15 1


Output


-1
5
8.7
8.1
-1


Input


5
1 1000 9999999
1 2000 -9999
3 1000 2000 0
2 1000
3 1000 2002 1


Output


1000
2000.0001

Note

In the first example all the queries of the 3-rd type cover all the events, it's simulation is following:

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(static_cast<unsigned int>(
    chrono::steady_clock::now().time_since_epoch().count()));
template <typename num_t>
inline void add_mod(num_t& a, const int& b, const int& m) {
  a = (a + b);
  if (a >= m) a -= m;
}
template <typename num_t>
inline bool update_max(num_t& a, const num_t& b) {
  return a < b ? a = b, true : false;
}
template <typename num_t>
inline bool update_min(num_t& a, const num_t& b) {
  return a > b ? a = b, true : false;
}
template <typename num_t>
num_t gcd(num_t lhs, num_t rhs) {
  return !lhs ? rhs : gcd(rhs % lhs, lhs);
}
template <typename num_t>
num_t pw(num_t n, num_t k, const num_t& mod) {
  if (k == -1) k = mod - 2;
  num_t res = 1;
  for (; k > 0; k >>= 1) {
    if (k & 1) res = 1ll * res * n % mod;
    n = 1ll * n * n % mod;
  }
  return res % mod;
}
const int inf = 1e9 + 7;
const int mod = 998244353;
const long long ll_inf = 9ll * inf * inf + 7;
const int MAX_N = 100000 + 7;
namespace Treap {
template <typename num_t>
struct Node {
  Node *left, *right;
  int priority;
  int size, rev;
  num_t key, lz;
  num_t minimum_value;
  num_t original_speed, speed;
  num_t change;
  struct Time {
    num_t left, right;
  };
  Time time_points;
  Node(num_t key, num_t s, Node* l = nullptr, Node* r = nullptr, int h = rng())
      : key(key), left(l), right(r), original_speed(s) {
    priority = h;
    size = (l != nullptr ? l->size : 0) + 1 + (r != nullptr ? r->size : 0);
    rev = lz = 0;
    minimum_value = 0;
    time_points = {key, key};
    change = 0;
    speed = original_speed;
  }
};
template <typename num_t>
void get_burst(num_t& value, num_t speed, num_t first, num_t last,
               long double& ans) {
  if (value == 0) {
    ans = first;
    return;
  }
  if (value + speed * (last - first) <= 0) {
    ans = ((long double)value / (-1.0 * speed)) + first;
    return;
  } else {
    value += speed * (last - first);
    return;
  }
}
template <typename num_t>
void get_burst_time(Node<num_t>* root, num_t& initial_value, num_t end_time,
                    long double& ans) {
  if (root == nullptr) return;
  if (initial_value + root->minimum_value > 0) {
    initial_value += root->change;
    return get_burst(initial_value, root->speed, root->time_points.right,
                     end_time, ans);
  }
  get_burst_time(root->left, initial_value, root->key, ans);
  if (ans >= 0) return;
  num_t nxt = end_time;
  if (root->right != nullptr) nxt = root->right->time_points.left;
  get_burst(initial_value, root->original_speed, root->key, nxt, ans);
  if (ans >= 0) return;
  get_burst_time(root->right, initial_value, end_time, ans);
}
template <typename num_t>
inline int size(Node<num_t>* x) {
  return x ? x->size : 0;
}
template <typename num_t>
inline void pull(Node<num_t>* x) {
  x->size = size(x->left) + 1 + size(x->right);
  x->time_points = {x->key, x->key};
  if (x->left != nullptr) x->time_points.left = x->left->time_points.left;
  if (x->right != nullptr) x->time_points.right = x->right->time_points.right;
  x->change = 0;
  x->minimum_value = 0;
  if (x->left != nullptr) {
    x->change = x->left->change +
                (x->key - x->left->time_points.right) * x->left->speed;
    x->minimum_value = min(x->left->minimum_value, x->change);
  }
  if (x->right != nullptr) {
    x->change += (x->right->time_points.left - x->key) * x->original_speed;
    x->minimum_value = min(x->minimum_value, x->change);
    x->minimum_value =
        min(x->minimum_value, x->change + x->right->minimum_value);
    x->change += x->right->change;
  }
  x->speed = x->original_speed;
  if (x->right != nullptr) x->speed = x->right->speed;
}
template <typename num_t>
inline void reverse(Node<num_t>* x) {
  if (x == nullptr) return;
  swap(x->left, x->right);
  x->rev ^= 1;
}
template <typename num_t>
inline void push_down(Node<num_t>* x, const num_t& value) {
  if (x == nullptr) return;
  x->key += value;
  x->lz += value;
}
template <typename num_t>
void push(Node<num_t>* x) {
  if (x->rev) {
    reverse(x->left);
    reverse(x->right);
    x->rev = 0;
  }
  if (x->lz) {
    push_down(x->left, x->lz);
    push_down(x->right, x->lz);
    x->lz = 0;
  }
}
template <typename num_t>
Node<num_t>* join(Node<num_t>* x, Node<num_t>* y) {
  if (x == nullptr) return y;
  if (y == nullptr) return x;
  if (x->priority < y->priority) {
    push(x);
    x->right = join(x->right, y);
    pull(x);
    return x;
  } else {
    push(y);
    y->left = join(x, y->left);
    pull(y);
    return y;
  }
}
template <typename num_t>
void split(Node<num_t>* x, Node<num_t>*& l, Node<num_t>*& r, int pos) {
  if (!x) {
    l = r = nullptr;
    return;
  }
  push(x);
  if (size(x->left) + 1 <= pos) {
    split(x->right, x->right, r, pos - size(x->left) - 1);
    pull(l = x);
  } else {
    split(x->left, l, x->left, pos);
    pull(r = x);
  }
}
template <typename num_t>
void split(Node<num_t>* root, Node<num_t>*& left, Node<num_t>*& mid,
           Node<num_t>*& right, int l, int r) {
  split(root, left, mid, l);
  split(mid, mid, right, r - l + 1);
}
template <typename num_t>
void reverse(Node<num_t>*& root, int l, int r) {
  Node<num_t>*left, *mid, *right;
  split(root, left, mid, right, l, r);
  reverse(mid);
  root = join(left, join(mid, right));
}
template <typename num_t>
void update(Node<num_t>*& root, int l, int r, const num_t& val) {
  Node<num_t>*left, *mid, *right;
  split(root, left, mid, right, l, r);
  push_down(mid, val);
  root = join(left, join(mid, right));
}
template <typename num_t>
void split(Node<num_t>* x, Node<num_t>*& l, Node<num_t>*& r,
           const function<bool(Node<num_t>*)>& go_right) {
  if (!x) {
    l = r = nullptr;
    return;
  }
  push(x);
  if (go_right(x)) {
    split(x->right, x->right, r, go_right);
    pull(l = x);
  } else {
    split(x->left, l, x->left, go_right);
    pull(r = x);
  }
}
template <typename num_t>
void query(Node<num_t>* root, num_t left_time, num_t right_time,
           num_t& initial_value) {
  long double temp = -1;
  if (initial_value) {
    Node<num_t>*left, *mid, *right;
    split<num_t>(root, left, mid,
                 [&](Node<num_t>* x) { return x->key < left_time; });
    split<num_t>(mid, mid, right,
                 [&](Node<num_t>* x) { return x->key <= right_time; });
    get_burst_time(mid, initial_value, right_time, temp);
    root = join(left, join(mid, right));
  } else {
    temp = left_time;
  }
  if (temp < 0)
    cout << -1 << '\n';
  else
    cout << temp << '\n';
}
template <typename num_t>
void insert(Node<num_t>*& x, num_t key, num_t speed) {
  Node<num_t>* y;
  split<num_t>(x, x, y, [&](Node<num_t>* x) { return x->key < key; });
  x = join(x, join(new Node<num_t>(key, speed), y));
}
template <typename num_t>
Node<num_t>* erase(Node<num_t>*& x, num_t key) {
  Node<num_t>*l, *r, *res;
  split<num_t>(x, l, res, [&](Node<num_t>* x) { return x->key < key; });
  split<num_t>(res, res, r, [&](Node<num_t>* x) { return x->key <= key; });
  x = join(l, r);
  return res;
}
template <typename num_t>
void free(Node<num_t>* x) {
  if (!x) return;
  free(x->left);
  free(x->right);
  delete x;
}
template <typename num_t>
int depth(Node<num_t>* x) {
  if (!x) return 0;
  push(x);
  return 1 + max(depth(x->left), depth(x->right));
}
template <typename num_t>
void trace(Node<num_t>* x, int isrt = 1) {
  if (!x) return;
  push(x);
  trace(x->left, 0);
  cerr << "(" << x->key << "," << x->change << ") ";
  trace(x->right, 0);
  if (isrt) {
    cerr << "\n";
  }
}
};  // namespace Treap
using namespace Treap;
void solve() {
  Node<long long>* root = nullptr;
  int q;
  cin >> q;
  cout << fixed << setprecision(8);
  while (q-- > 0) {
    int op;
    cin >> op;
    long long u, v;
    if (op == 1) {
      cin >> u >> v;
      insert(root, u, v);
    } else if (op == 2) {
      cin >> u;
      erase(root, u);
    } else {
      long long in_v;
      cin >> u >> v >> in_v;
      query(root, u, v, in_v);
    }
  }
  free(root);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  const bool multiple_test = false;
  int test = 1;
  if (multiple_test) cin >> test;
  for (int i = 0; i < test; ++i) {
    solve();
  }
}