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;
inline int gi() {
  int data = 0, m = 1;
  char ch = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') {
    m = 0;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    data = (data << 1) + (data << 3) + (ch ^ 48);
    ch = getchar();
  }
  return (m) ? data : -data;
}
long double Ans;
int n, Q, X[100005 << 2], Key[100005 << 2], root, xox;
bool flag;
long double last_speed;
struct Qry {
  int op, l, r;
  long double v;
} q[100005];
inline void Init() {
  for (int i = 1; i <= Q; i++) {
    q[i].op = gi();
    q[i].l = gi();
    if (q[i].op != 2) q[i].r = gi();
    if (q[i].op == 3) q[i].v = gi();
  }
  xox = 0;
  for (int i = 1; i <= Q; i++) X[++xox] = q[i].l;
  for (int i = 1; i <= Q; i++)
    if (q[i].op == 3) X[++xox] = q[i].r;
  sort(X + 1, X + xox + 1);
  xox = unique(X + 1, X + xox + 1) - X - 1;
  return;
}
struct Node {
  int ls, rs;
  long double Ltim, Rtim, tim, v, rv;
  long double res, mn;
  inline Node() { Ltim = Rtim = v = res = tim = rv = mn = 0; }
  inline Node(int r1, int r2, long double a, long double b, long double c,
              long double d, long double e, long double ee, long double eee) {
    ls = r1;
    rs = r2;
    Ltim = a;
    Rtim = b;
    tim = c;
    v = d;
    rv = e;
    res = ee;
    mn = eee;
  }
};
Node t[100005 << 2];
inline void PushUp(int o) {
  int lc = t[o].ls, rc = t[o].rs;
  t[o].res = 0;
  t[o].mn = 0;
  t[o].rv = t[o].v;
  t[o].Ltim = t[o].Rtim = t[o].tim;
  if (lc) {
    t[o].mn = min(t[o].mn, t[lc].mn),
    t[o].res = t[lc].res + (t[o].tim - t[lc].Rtim) * t[lc].rv;
    t[o].mn = min(t[o].mn, t[o].res);
    t[o].Ltim = t[lc].Ltim;
  }
  if (rc) {
    t[o].res = t[o].res + (t[rc].Ltim - t[o].tim) * t[o].v;
    t[o].mn = min(t[o].mn, t[o].res);
    t[o].mn = min(t[o].mn, t[o].res + t[rc].mn);
    t[o].res = t[o].res + t[rc].res;
    t[o].rv = t[rc].rv;
    t[o].Rtim = t[rc].Rtim;
  }
  return;
}
struct Droot {
  int r1, r2;
} tmp, tmp2;
int Merge(int o, int os) {
  if (!o || !os) return o + os;
  int r;
  if (Key[o] <= Key[os])
    r = o, t[o].rs = Merge(t[o].rs, os);
  else if (Key[o] > Key[os])
    r = os, t[os].ls = Merge(o, t[os].ls);
  PushUp(r);
  return r;
}
Droot Split(int o, int Lim) {
  if (!o) return (Droot){0, 0};
  Droot r;
  if (t[o].tim > Lim)
    r = Split(t[o].ls, Lim), t[o].ls = r.r2, r.r2 = o;
  else
    r = Split(t[o].rs, Lim), t[o].rs = r.r1, r.r1 = o;
  PushUp(o);
  return r;
}
void Query(int o, long double &vl) {
  if (vl < 1e-7) {
    Ans = t[o].Ltim;
    flag = true;
    return;
  }
  if (flag || !o || t[o].mn + vl > 0) return;
  int lc = t[o].ls, rc = t[o].rs;
  long double ret = 0, delta = 0;
  if (lc && !flag) {
    if (t[lc].mn + vl <= 0) {
      Query(lc, vl);
      return;
    }
    ret = ret + t[lc].res;
    delta = (t[o].tim - t[lc].Rtim) * t[lc].rv;
    if (vl + ret + delta <= 0) {
      Ans = t[lc].Rtim + abs(vl + ret) / abs(t[lc].rv);
      flag = true;
      return;
    }
    ret += delta;
  }
  if (rc && !flag) {
    delta = (t[rc].Ltim - t[o].tim) * t[o].v;
    if (vl + ret + delta <= 0) {
      Ans = t[o].tim + abs(vl + ret) / abs(t[o].v);
      flag = true;
      return;
    }
    ret += delta;
    vl += ret;
    Query(rc, vl);
  }
  return;
}
double query(int x, int r, long long v) {
  int ls = t[x].ls, rs = t[x].rs;
  if (ls) {
    if (v + t[ls].mn <= 0) return query(ls, t[x].tim, v);
    v += t[ls].res + 1ll * t[ls].rv * (t[x].tim - t[ls].Rtim);
    if (v <= 0) return t[x].tim - 1.0 * v / t[ls].rv;
  }
  if (rs) {
    v += 1ll * t[x].v * (t[rs].Ltim - t[x].tim);
    if (v <= 0) return t[rs].Ltim - 1.0 * v / t[x].v;
    if (v + t[rs].mn <= 0) return query(rs, r, v);
    v += t[rs].res;
  }
  v += 1ll * t[x].rv * (r - t[x].Rtim);
  return r - 1.0 * v / t[x].rv;
}
void Check(int o) {
  printf("Node%d: ls=%d , rs=%d Ltim=%.0Lf , Rtim=%.0Lf\n", o, t[o].ls, t[o].rs,
         t[o].Ltim, t[o].Rtim);
  if (t[o].ls) Check(t[o].ls);
  if (t[o].rs) Check(t[o].rs);
}
map<int, long double> g;
int main() {
  Q = gi();
  Init();
  for (int i = 1; i <= xox; i++) Key[i] = 1 + rand() % 198919890;
  int tm, l, r;
  long double s, v;
  root = 0;
  for (int i = 1; i <= Q; i++) {
    if (q[i].op == 1) {
      tm = lower_bound(X + 1, X + xox + 1, q[i].l) - X;
      s = q[i].r;
      tmp = Split(root, q[i].l);
      t[tm] = Node(0, 0, X[tm], X[tm], X[tm], s, s, 0.0, 0.0);
      root = Merge(Merge(tmp.r1, tm), tmp.r2);
      g[tm] = s;
    } else if (q[i].op == 2) {
      tm = lower_bound(X + 1, X + xox + 1, q[i].l) - X;
      s = g[tm];
      tmp = Split(root, q[i].l - 1);
      tmp2 = Split(tmp.r2, q[i].l);
      root = Merge(tmp.r1, tmp2.r2);
    } else if (q[i].op == 3) {
      l = q[i].l;
      r = q[i].r;
      v = q[i].v;
      flag = false;
      Ans = -1;
      tmp = Split(root, l - 1);
      tmp2 = Split(tmp.r2, r);
      Query(tmp2.r1, v);
      if (tmp2.r1 && !flag) {
        v = q[i].v + t[tmp2.r1].res;
        last_speed = t[tmp2.r1].rv;
        if (last_speed < 0) {
          Ans = t[tmp2.r1].Rtim + v / abs(last_speed);
          flag = true;
        }
        if (Ans > (long double)r) flag = false;
      }
      if (q[i].v < 1e-7) {
        Ans = l;
      }
      if (!flag)
        puts("-1");
      else
        printf("%.8lf\n", (double)Ans);
      root = Merge(Merge(tmp.r1, tmp2.r1), tmp2.r2);
    }
  }
  return 0;
}