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;
const int MAXN = 110000;
struct Treap {
  struct Node {
    int ls, rs, wgt;
    int time, tL, tR;
    int speed, speedR;
    long long res, mn;
  } tr[MAXN];
  int cnt, root;
  int newNode(int p, int k) {
    int x = ++cnt;
    tr[x].ls = tr[x].rs = 0;
    tr[x].wgt = rand();
    tr[x].time = tr[x].tL = tr[x].tR = p;
    tr[x].speed = tr[x].speedR = k;
    tr[x].res = tr[x].mn = 0;
    return x;
  }
  void pushup(int x) {
    int lc = tr[x].ls, rc = tr[x].rs;
    if (lc && rc) {
      tr[x].tL = tr[lc].tL;
      tr[x].tR = tr[rc].tR;
      tr[x].speedR = tr[rc].speedR;
      tr[x].res = tr[x].mn = 0;
      tr[x].mn = min(tr[x].mn, tr[lc].mn);
      tr[x].res += tr[lc].res + 1ll * tr[lc].speedR * (tr[x].time - tr[lc].tR);
      tr[x].mn = min(tr[x].mn, tr[x].res);
      tr[x].res += 1ll * tr[x].speed * (tr[rc].tL - tr[x].time);
      tr[x].mn = min(tr[x].mn, tr[x].res + tr[rc].mn);
      tr[x].res += tr[rc].res;
    } else if (lc) {
      tr[x].tL = tr[lc].tL;
      tr[x].tR = tr[x].time;
      tr[x].speedR = tr[x].speed;
      tr[x].res = tr[x].mn = 0;
      tr[x].mn = min(tr[x].mn, tr[lc].mn);
      tr[x].res += tr[lc].res + 1ll * tr[lc].speedR * (tr[x].time - tr[lc].tR);
      tr[x].mn = min(tr[x].mn, tr[x].res);
    } else if (rc) {
      tr[x].tL = tr[x].time;
      tr[x].tR = tr[rc].tR;
      tr[x].speedR = tr[rc].speedR;
      tr[x].res = tr[x].mn = 0;
      tr[x].res += 1ll * tr[x].speed * (tr[rc].tL - tr[x].time);
      tr[x].mn = min(tr[x].mn, tr[x].res + tr[rc].mn);
      tr[x].res += tr[rc].res;
    } else {
      tr[x].tL = tr[x].tR = tr[x].time;
      tr[x].speedR = tr[x].speed;
      tr[x].res = tr[x].mn = 0;
    }
  }
  void split(int o, int& x, int& y, int p) {
    if (!o) {
      x = y = 0;
      return;
    }
    if (tr[o].time < p)
      x = o, split(tr[o].rs, tr[x].rs, y, p);
    else
      y = o, split(tr[o].ls, x, tr[y].ls, p);
    pushup(o);
  }
  void merge(int x, int y, int& o) {
    if (!x || !y) {
      o = x + y;
      return;
    }
    if (tr[x].wgt < tr[y].wgt)
      o = x, merge(tr[x].rs, y, tr[o].rs);
    else
      o = y, merge(x, tr[y].ls, tr[o].ls);
    pushup(o);
  }
  void insert(int p, int k) {
    int a, b, c;
    split(root, a, b, p);
    merge(a, newNode(p, k), c);
    merge(c, b, root);
  }
  void erase(int p) {
    int a, b, c, d;
    split(root, a, b, p);
    split(b, c, d, p + 1);
    merge(a, d, root);
  }
  void print(int x) {
    if (!x) return;
    print(tr[x].ls);
    printf("%d %d %d %d %d %lld %lld\n", x, tr[x].ls, tr[x].rs, tr[x].time,
           tr[x].speed, tr[x].res, tr[x].mn);
    print(tr[x].rs);
  }
  double query(int l, int r, long long v) {
    if (v == 0) return l;
    int a, b, c, d, e, x, y;
    split(root, a, b, l);
    split(b, c, d, r);
    merge(c, y = newNode(r, 0), e);
    x = e;
    while (1) {
      long long t1 = tr[x].ls
                         ? tr[tr[x].ls].res + 1ll * tr[tr[x].ls].speedR *
                                                  (tr[x].time - tr[tr[x].ls].tR)
                         : 0;
      long long t2 =
          tr[x].rs ? 1ll * tr[x].speed * (tr[tr[x].rs].tL - tr[x].time) : 0;
      if (tr[x].ls && v + min(tr[tr[x].ls].mn, t1) <= 0)
        x = tr[x].ls;
      else if (tr[x].rs && v + t1 + t2 > 0)
        v += t1 + t2, x = tr[x].rs;
      else {
        v += t1;
        break;
      }
    }
    double res = x != y ? tr[x].time - 1.0 * v / tr[x].speed : -1;
    split(e, b, c, r);
    merge(a, b, c);
    merge(c, d, root);
    return res;
  }
} treap;
int main() {
  srand(1);
  int q;
  scanf("%d", &q);
  while (q--) {
    int opt;
    scanf("%d", &opt);
    if (opt == 1) {
      int p, k;
      scanf("%d%d", &p, &k);
      treap.insert(p, k);
    } else if (opt == 2) {
      int p;
      scanf("%d", &p);
      treap.erase(p);
    } else {
      int l, r, v;
      scanf("%d%d%d", &l, &r, &v);
      printf("%.7lf\n", treap.query(l, r, v));
    }
  }
  return 0;
}