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;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
struct seg_tree {
  int S;
  vector<T> value;
  seg_tree<T>(int S) : S(S) { value.resize(2 * S); }
  void rebuild() {
    for (int i = S - 1; i > 0; i--) value[i] = value[2 * i] + value[2 * i + 1];
  }
  void upd(int i, T v) {
    i += S;
    value[i] = v;
    while (i > 1) {
      i /= 2;
      value[i] = value[2 * i] + value[2 * i + 1];
    }
  }
  T query(int i, int j) {
    T res_left, res_right;
    for (i += S, j += S; i <= j; i /= 2, j /= 2) {
      if ((i & 1) == 1) res_left = res_left + value[i++];
      if ((j & 1) == 0) res_right = value[j--] + res_right;
    }
    return res_left + res_right;
  }
};
struct time_seg {
  int begin = -1, end = -1;
  int first = -1, last = -1;
  ll rate = LLONG_MIN, total = 0, low = 0;
  time_seg() {}
  time_seg(int begin, int end) : begin(begin), end(end) {
    first = -1, last = -1;
  }
  time_seg(int begin, int end, int flow) : begin(begin), end(end) {
    first = begin, last = begin;
    rate = flow;
    total = rate * (end - begin);
    low = min(0ll, total);
  }
  time_seg operator+(const time_seg& o) const {
    if (begin == -1) return o;
    if (o.begin == -1) return *this;
    if (first == -1 && o.first == -1) {
      time_seg res;
      res.begin = begin, res.end = o.end;
      res.first = -1;
      return res;
    }
    if (first == -1) {
      time_seg res = o;
      res.begin = begin;
      return res;
    }
    if (o.first == -1) {
      time_seg res = *this;
      res.end = o.end;
      res.total += res.rate * (o.end - end);
      res.low = min(res.low, res.total);
      return res;
    }
    time_seg res;
    res.begin = begin, res.end = o.end;
    res.first = first, res.last = o.last;
    res.rate = o.rate;
    ll add = (o.first - end) * rate;
    res.total = total + add + o.total;
    res.low = min(low, min(total + add, total + add + o.low));
    return res;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int Q;
  cin >> Q;
  vi coord;
  vector<array<int, 4>> que(Q);
  for (int q = 0; q < Q; q++) {
    int op, t, s, l, r, v;
    cin >> op;
    if (op == 1) {
      cin >> t >> s;
      que[q] = {1, t, s, 0};
      coord.push_back(t);
    } else if (op == 2) {
      cin >> t;
      que[q] = {2, t, 0, 0};
      coord.push_back(t);
    } else {
      cin >> l >> r >> v;
      que[q] = {3, l, r, v};
    }
  }
  sort((coord).begin(), (coord).end());
  coord.erase(unique((coord).begin(), (coord).end()), coord.end());
  coord.push_back(1e9 + 1);
  seg_tree<time_seg> st(coord.size());
  for (int i = 0; i + 1 < coord.size(); i++) {
    st.value[st.S + i] = time_seg(coord[i], coord[i + 1]);
  }
  st.rebuild();
  for (int q = 0; q < Q; q++) {
    int op = que[q][0];
    if (op == 1) {
      int t = que[q][1], s = que[q][2];
      int i = lower_bound((coord).begin(), (coord).end(), t) - coord.begin();
      st.upd(i, time_seg(coord[i], coord[i + 1], s));
    } else if (op == 2) {
      int t = que[q][1];
      int i = lower_bound((coord).begin(), (coord).end(), t) - coord.begin();
      st.upd(i, time_seg(coord[i], coord[i + 1]));
    } else if (op == 3) {
      int l = que[q][1], r = que[q][2];
      ll v = que[q][3];
      if (v == 0) {
        printf("%.6f\n", double(l));
        continue;
      }
      int i1 = lower_bound((coord).begin(), (coord).end(), l) - coord.begin();
      if (coord[i1] > r) {
        printf("-1\n");
        continue;
      }
      int start = i1;
      int lo = i1, hi = coord.size() - 1;
      while (lo <= hi) {
        int mi = (lo + hi) / 2;
        time_seg ts = st.query(i1, mi);
        if (v + ts.low <= 0) {
          hi = mi - 1;
        } else {
          start = mi;
          lo = mi + 1;
        }
      }
      time_seg fin = st.query(i1, start);
      if (v + fin.low <= 0) {
        double ans = fin.begin + double(v) / -fin.rate;
        if (ans > r) {
          printf("-1\n");
        } else
          printf("%.6f\n", ans);
        continue;
      }
      if (fin.end >= r) {
        printf("-1\n");
        continue;
      }
      ll rate = fin.rate;
      if (st.value[st.S + start + 1].first != -1) {
        rate = st.value[st.S + start + 1].rate;
      }
      assert(rate < 0);
      double ans = fin.end + double(v + fin.total) / -rate;
      if (ans > r) {
        printf("-1\n");
        continue;
      }
      printf("%.6f\n", ans);
    }
  }
  return 0;
}