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 N = 3e5 + 100;
long long inf = 4e18;
struct Query {
  int typ, t, cap, l, r, v;
} Q[N];
struct node {
  long long sum, mn;
  node() { sum = 0, mn = 0; }
  node(long long s, long long m) { sum = s, mn = m; }
} tr[4 * N];
node Merge(node a, node b) {
  node ret;
  ret.sum = a.sum + b.sum;
  ret.mn = min(a.mn, a.sum + b.mn);
  return ret;
}
void upd(int cn, int b, int e, int i, long long x) {
  if (b > i or e < i) {
    return;
  }
  int lc = 2 * cn, rc = lc + 1, mid = (b + e) / 2;
  if (b >= i and e <= i) {
    tr[cn].sum += x;
    tr[cn].mn += x;
    return;
  }
  upd(lc, b, mid, i, x);
  upd(rc, mid + 1, e, i, x);
  tr[cn] = Merge(tr[lc], tr[rc]);
}
node query(int cn, int b, int e, int i, int j) {
  if (b > j or e < i) return node(0, inf);
  if (b >= i and e <= j) {
    return tr[cn];
  }
  int lc = 2 * cn, rc = lc + 1, mid = (b + e) / 2;
  return Merge(query(lc, b, mid, i, j), query(rc, mid + 1, e, i, j));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << setprecision(10) << fixed;
  int q;
  cin >> q;
  set<int> allt;
  for (int i = 1; i <= q; i++) {
    cin >> Q[i].typ;
    if (Q[i].typ == 1) {
      cin >> Q[i].t >> Q[i].cap;
      allt.insert(Q[i].t);
    } else if (Q[i].typ == 2) {
      cin >> Q[i].t;
      allt.insert(Q[i].t);
    } else {
      cin >> Q[i].l >> Q[i].r >> Q[i].v;
    }
  }
  allt.insert(0);
  allt.insert(2e9);
  map<int, int> Mt, revt;
  int kkk = 0;
  for (int x : allt) {
    Mt[x] = ++kkk;
    revt[kkk] = x;
  }
  set<int> times;
  times.insert(kkk);
  times.insert(1);
  map<int, int> caps;
  caps[kkk] = 0;
  caps[1] = 0;
  for (int i = 1; i <= q; i++) {
    if (Q[i].typ == 1) {
      int tt = Mt[Q[i].t];
      int c = Q[i].cap;
      auto it = times.lower_bound(tt);
      long long d = (revt[*it] - Q[i].t);
      upd(1, 1, kkk, tt, 1ll * c * d);
      it--;
      int prev_t = *it;
      upd(1, 1, kkk, prev_t, -1ll * caps[prev_t] * d);
      caps[tt] = c;
      times.insert(tt);
    } else if (Q[i].typ == 2) {
      int tt = Mt[Q[i].t];
      int c = caps[tt];
      auto it = times.upper_bound(tt);
      long long d = (revt[*it] - Q[i].t);
      upd(1, 1, kkk, tt, -1ll * c * d);
      it--;
      it--;
      int prev_t = *it;
      upd(1, 1, kkk, prev_t, +1ll * caps[prev_t] * d);
      times.erase(tt);
      caps[tt] = 0;
    } else {
      if (Q[i].v == 0) {
        cout << Q[i].l << "\n";
        continue;
      }
      if (Q[i].l == Q[i].r) {
        cout << "-1"
             << "\n";
        continue;
      }
      int l = *allt.lower_bound(Q[i].l);
      auto itt = allt.upper_bound(Q[i].r);
      itt--;
      int r = *itt;
      if (l > r) {
        cout << "-1"
             << "\n";
        continue;
      }
      l = Mt[l], r = Mt[r];
      int lo = l, hi = r, v = Q[i].v;
      if (query(1, 1, kkk, lo, hi).mn + v > 0)
        cout << "-1"
             << "\n";
      else {
        while (hi > lo) {
          int mid = (hi + lo) >> 1;
          if (query(1, 1, kkk, l, mid).mn + v <= 0)
            hi = mid;
          else
            lo = mid + 1;
        }
        long long lage = abs(-query(1, 1, kkk, l, lo - 1).sum - v);
        double ans = revt[lo] + 1.0 * lage / abs(caps[lo]);
        if (ans > Q[i].r) {
          cout << "-1"
               << "\n";
        } else {
          cout << ans << "\n";
        }
      }
    }
  }
  return 0;
}