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 __int128 iinf = 1e9 + 10;
const __int128 inf = 1e18 + 2;
const __int128 INF = 1e25;
const __int128 mod = 1e9 + 7;
void GG() {
  cout << "0\n";
  exit(0);
}
__int128 mpow(__int128 a, __int128 n, __int128 mo = mod) {
  __int128 re = 1;
  while (n > 0) {
    if (n & 1) re = re * a % mo;
    a = a * a % mo;
    n >>= 1;
  }
  return re;
}
__int128 inv(__int128 b, __int128 mo = mod) {
  if (b == 1) return b;
  return (mo - mo / b) * inv(mo % b) % mo;
}
const __int128 maxn = 1e5 + 5;
__int128 mn[maxn * 4], tg[maxn * 4];
set<__int128> have;
void push(__int128 o, __int128 l, __int128 r) {
  if (tg[o]) {
    mn[o] += tg[o];
    if (l != r) {
      tg[o * 2] += tg[o];
      tg[o * 2 + 1] += tg[o];
    }
    tg[o] = 0;
  }
}
__int128 n;
void MO(__int128 L, __int128 R, __int128 v, __int128 o = 1, __int128 l = 0,
        __int128 r = n - 1) {
  push(o, l, r);
  if (l > R || r < L) return;
  if (l >= L && r <= R) {
    tg[o] += v;
    push(o, l, r);
    return;
  }
  __int128 mid = (l + r) / 2;
  MO(L, R, v, o * 2, l, mid);
  MO(L, R, v, o * 2 + 1, mid + 1, r);
  mn[o] = min(mn[o * 2], mn[o * 2 + 1]);
}
__int128 QU(__int128 L, __int128 R, __int128 o = 1, __int128 l = 0,
            __int128 r = n - 1) {
  push(o, l, r);
  if (l > R || r < L) return INF;
  if (l >= L && r <= R) {
    return mn[o];
  }
  __int128 mid = (l + r) / 2;
  return min(QU(L, R, o * 2, l, mid), QU(L, R, o * 2 + 1, mid + 1, r));
}
struct Que {
  __int128 Tp;
  __int128 t, second, l, r, v;
};
__int128 slope[maxn];
bool state[maxn];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  signed Q;
  cin >> Q;
  vector<Que> queries;
  vector<__int128> allt;
  allt.push_back(0);
  allt.push_back(1000000005);
  have.insert(0);
  have.insert(1000000005);
  for (__int128 i = 0; i < Q; ++i) {
    signed Tp;
    cin >> Tp;
    if (Tp == 1) {
      signed t, second;
      cin >> t >> second;
      allt.push_back(t);
      queries.push_back({Tp, t, second, 0, 0, 0});
    }
    if (Tp == 2) {
      signed t;
      cin >> t;
      allt.push_back(t);
      queries.push_back({Tp, t, 0, 0, 0, 0});
    }
    if (Tp == 3) {
      signed l, r, v;
      cin >> l >> r >> v;
      queries.push_back({Tp, 0, 0, l, r, v});
    }
  }
  (sort(allt.begin(), allt.end()),
   allt.resize(distance(allt.begin(), unique(allt.begin(), allt.end()))));
  n = (__int128)allt.size();
  ;
  MO(1, n - 2, inf);
  state[0] = 1;
  cout << fixed << setprecision(10);
  for (Que q : queries) {
    __int128 lp, rp;
    if (q.Tp == 1) {
      lp = *prev(have.upper_bound(q.t)), rp = *have.upper_bound(q.t);
      __int128 lat = lower_bound(allt.begin(), allt.end(), lp) - allt.begin();
      __int128 rat = lower_bound(allt.begin(), allt.end(), rp) - allt.begin();
      __int128 mat = lower_bound(allt.begin(), allt.end(), q.t) - allt.begin();
      assert(rat != mat);
      assert(lat != mat);
      __int128 bfr = QU(rat, rat);
      __int128 myv = QU(lat, lat) + slope[lat] * (q.t - lp);
      __int128 prevme = QU(mat, mat);
      ;
      MO(mat, mat, myv - prevme);
      ;
      assert(myv == QU(mat, mat));
      slope[mat] = q.second;
      __int128 newr = myv + (rp - q.t) * q.second;
      MO(rat, n - 1, newr - bfr);
      ;
      ;
      have.insert(q.t);
    }
    if (q.Tp == 2) {
      if (!have.count(q.t)) assert(0);
      have.erase(q.t);
      lp = *prev(have.upper_bound(q.t)), rp = *have.upper_bound(q.t);
      __int128 lat = lower_bound(allt.begin(), allt.end(), lp) - allt.begin();
      __int128 rat = lower_bound(allt.begin(), allt.end(), rp) - allt.begin();
      __int128 mat = lower_bound(allt.begin(), allt.end(), q.t) - allt.begin();
      MO(mat, mat, inf - QU(mat, mat));
      __int128 oldr = QU(rat, rat);
      __int128 newr = (rp - lp) * slope[lat] + QU(lat, lat);
      MO(rat, n - 1, newr - oldr);
    }
    if (q.Tp == 3) {
      __int128 st = *have.lower_bound(q.l),
               stp = lower_bound(allt.begin(), allt.end(), st) - allt.begin();
      __int128 mat = lower_bound(allt.begin(), allt.end(), q.l) - allt.begin();
      __int128 myv = QU(stp, stp);
      ;
      if (q.v == 0) {
        cout << (long long)q.l << '\n';
        continue;
      }
      myv -= q.v;
      __int128 l = mat, r = n - 1;
      while (l != r) {
        __int128 mid = (l + r) / 2;
        if (QU(mat, mid) <= myv) {
          r = mid;
        } else {
          l = mid + 1;
        }
      };
      if (l >= n || l == mat) {
        cout << -1 << '\n';
        continue;
      }
      __int128 prv = *prev(have.lower_bound(allt[l])),
               pp = lower_bound(allt.begin(), allt.end(), prv) - allt.begin();
      __int128 A = QU(pp, pp), B = QU(l, l);
      ;
      ;
      if (B <= myv) {
        if (A == B)
          while (1)
            ;
        long double ans =
            (myv - A) / (long double)(B - A) * (allt[l] - prv) + prv;
        if (ans <= q.r + 1e-12)
          cout << ans << '\n';
        else
          cout << -1 << '\n';
      } else {
        cout << -1 << '\n';
      }
    }
  }
}