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>
const int MAXN = 1e5 + 10;
struct info {
  long long sm, mi;
  friend info operator+(info a, info b) {
    a.mi = std::min(a.mi, b.mi + a.sm);
    a.sm += b.sm;
    return a;
  }
} tree[MAXN], val[MAXN];
int ls[MAXN], rs[MAXN], ds[MAXN];
int son[MAXN][2], fa[MAXN], idx;
int get(int x, int b = 1) { return son[fa[x]][b] == x; }
void update(int x) { tree[x] = tree[son[x][0]] + val[x] + tree[son[x][1]]; }
void rotate(int x) {
  int y = fa[x], z = fa[y];
  bool b = get(x);
  if (z) son[z][get(y)] = x;
  son[y][b] = son[x][!b], son[x][!b] = y;
  fa[x] = z, fa[y] = x;
  if (int t = son[y][b]) fa[t] = y;
  update(y);
}
int rt;
void splay(int x, int to = 0) {
  if (!x) return;
  for (; fa[x] != to; rotate(x))
    if (fa[fa[x]] != to) rotate(get(x) ^ get(fa[x]) ? x : fa[x]);
  update(x);
  if (to == 0) rt = x;
}
int lower_bound(int v, int up = 0) {
  int now = rt, res = 0, lst = 0;
  while (now) {
    lst = now;
    if (ls[now] <= v)
      res = now, now = son[now][1];
    else
      now = son[now][0];
  }
  splay(lst, up), splay(res, up);
  return res;
}
int leftmost(int x, int up = 0) {
  while (son[x][0]) x = son[x][0];
  splay(x, up);
  return x;
}
void calcval(int u) {
  val[u].sm = (long long)(rs[u] - ls[u]) * ds[u];
  val[u].mi = std::min(val[u].sm, 0ll);
  update(u);
}
int main() {
  std::ios_base::sync_with_stdio(false), std::cin.tie(0);
  std::cout << std::fixed << std::setprecision(8);
  int Q;
  std::cin >> Q;
  rt = idx = 1;
  ls[rt] = 1.5e9, rs[rt] = 1.5e9, ds[rt] = 0;
  ++idx;
  ls[idx] = -1.5e9, rs[idx] = 1.5e9, ds[idx] = 0;
  fa[idx] = rt, son[rt][0] = idx;
  calcval(idx);
  calcval(rt);
  while (Q-- > 0) {
    int opt, t, l, r;
    long long v;
    std::cin >> opt;
    if (opt == 1) {
      std::cin >> t >> v;
      int at = lower_bound(t), u = ++idx, L, R;
      ls[u] = t, ds[u] = v;
      rs[u] = rs[at], rs[at] = t;
      calcval(at);
      R = son[at][1], fa[R] = son[at][1] = 0;
      L = at;
      son[u][0] = L;
      fa[L] = u;
      son[u][1] = R;
      fa[R] = u;
      calcval(rt = u);
    } else if (opt == 2) {
      std::cin >> t;
      int at = lower_bound(t);
      int L = lower_bound(t - 1, at), R = leftmost(son[at][1], at);
      rs[L] = rs[at], calcval(L);
      fa[R] = 0;
      son[R][0] = L;
      fa[L] = R, update(rt = R);
    } else {
      std::cin >> l >> r >> v;
      if (!v) {
        std::cout << l << '\n';
        continue;
      }
      int R = lower_bound(r);
      R = leftmost(son[R][1]);
      int L = lower_bound(l - 1, R);
      int u = son[L][1], lst = 0, ans = 0;
      info pre = (info){0ll, 0ll};
      while (u) {
        lst = u;
        info vn = pre + tree[son[u][0]] + val[u];
        if (vn.mi + v <= 0)
          ans = u, u = son[u][0];
        else
          pre = vn, u = son[u][1];
      }
      splay(lst, L);
      splay(u = ans, L);
      v += tree[son[u][0]].sm;
      if (ans == 0 || v + (long long)ds[u] * (r - ls[u]) > 0)
        std::cout << -1 << '\n';
      else
        std::cout << (-v / (double)ds[u] + ls[u]) << '\n';
    }
  }
  return 0;
}