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 INF1 = 1000000001;
const long long INF2 = 1100000000000000000;
struct lazy_segment_tree {
  int N;
  vector<long long> x;
  vector<long long> mn;
  vector<bool> is_upd;
  vector<long long> lazy_a, lazy_b;
  lazy_segment_tree(vector<long long> &x) : x(x) {
    int n = x.size();
    N = 1;
    while (N < n) {
      N *= 2;
    }
    while (x.size() < N) {
      x.push_back(INF1);
    }
    mn = vector<long long>(N * 2 - 1, INF2);
    is_upd = vector<bool>(N * 2 - 1, false);
    lazy_a = vector<long long>(N * 2 - 1, 0);
    lazy_b = vector<long long>(N * 2 - 1, 0);
  }
  void push(int i, int j) {
    if (is_upd[i]) {
      is_upd[j] = true;
      lazy_a[j] = lazy_a[i];
      lazy_b[j] = lazy_b[i];
    } else {
      lazy_b[j] += lazy_b[i];
    }
  }
  void eval(int i, int l, int r) {
    if (i < N - 1) {
      push(i, i * 2 + 1);
      push(i, i * 2 + 2);
    }
    if (is_upd[i]) {
      if (lazy_a[i] >= 0) {
        mn[i] = x[l] * lazy_a[i] + lazy_b[i];
      } else {
        mn[i] = x[r - 1] * lazy_a[i] + lazy_b[i];
      }
    } else {
      mn[i] += lazy_b[i];
    }
    is_upd[i] = false;
    lazy_b[i] = 0;
  }
  void range_add(int L, int R, long long x, int i, int l, int r) {
    eval(i, l, r);
    if (r <= L || R <= l) {
      return;
    } else if (L <= l && r <= R) {
      lazy_b[i] = x;
      eval(i, l, r);
    } else {
      int m = (l + r) / 2;
      range_add(L, R, x, i * 2 + 1, l, m);
      range_add(L, R, x, i * 2 + 2, m, r);
      mn[i] = min(mn[i * 2 + 1], mn[i * 2 + 2]);
    }
  }
  void range_add(int L, int R, long long x) { range_add(L, R, x, 0, 0, N); }
  void range_update(int L, int R, long long a, long long b, int i, int l,
                    int r) {
    eval(i, l, r);
    if (r <= L || R <= l) {
      return;
    } else if (L <= l && r <= R) {
      is_upd[i] = true;
      lazy_a[i] = a;
      lazy_b[i] = b;
      eval(i, l, r);
    } else {
      int m = (l + r) / 2;
      range_update(L, R, a, b, i * 2 + 1, l, m);
      range_update(L, R, a, b, i * 2 + 2, m, r);
      mn[i] = min(mn[i * 2 + 1], mn[i * 2 + 2]);
    }
  }
  void range_update(int L, int R, long long a, long long b) {
    range_update(L, R, a, b, 0, 0, N);
  }
  long long range_min(int L, int R, int i, int l, int r) {
    eval(i, l, r);
    if (r <= L || R <= l) {
      return INF2;
    } else if (L <= l && r <= R) {
      return mn[i];
    } else {
      int m = (l + r) / 2;
      return min(range_min(L, R, i * 2 + 1, l, m),
                 range_min(L, R, i * 2 + 2, m, r));
    }
  }
  long long range_min(int L, int R) { return range_min(L, R, 0, 0, N); }
  long long operator[](int k) { return range_min(k, k + 1, 0, 0, N); }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(7);
  int q;
  cin >> q;
  vector<tuple<int, int, int, int>> query(q);
  for (int i = 0; i < q; i++) {
    int T;
    cin >> T;
    if (T == 1) {
      int t, s;
      cin >> t >> s;
      query[i] = make_tuple(1, t, s, -1);
    }
    if (T == 2) {
      int t;
      cin >> t;
      query[i] = make_tuple(2, t, -1, -1);
    }
    if (T == 3) {
      int l, r, v;
      cin >> l >> r >> v;
      query[i] = make_tuple(3, l, r, v);
    }
  }
  vector<long long> time;
  time.push_back(0);
  time.push_back(INF1);
  for (int i = 0; i < q; i++) {
    if (get<0>(query[i]) == 1) {
      time.push_back(get<1>(query[i]));
    }
    if (get<0>(query[i]) == 3) {
      time.push_back(get<1>(query[i]));
      time.push_back(get<2>(query[i]));
    }
  }
  sort(time.begin(), time.end());
  time.erase(unique(time.begin(), time.end()), time.end());
  for (int i = 0; i < q; i++) {
    if (get<0>(query[i]) == 1) {
      get<1>(query[i]) =
          lower_bound(time.begin(), time.end(), get<1>(query[i])) -
          time.begin();
    }
    if (get<0>(query[i]) == 2) {
      get<1>(query[i]) =
          lower_bound(time.begin(), time.end(), get<1>(query[i])) -
          time.begin();
    }
    if (get<0>(query[i]) == 3) {
      get<1>(query[i]) =
          lower_bound(time.begin(), time.end(), get<1>(query[i])) -
          time.begin();
      get<2>(query[i]) =
          lower_bound(time.begin(), time.end(), get<2>(query[i])) -
          time.begin();
    }
  }
  int n = time.size();
  map<int, int> speed;
  speed[0] = 0;
  speed[n - 1] = 0;
  lazy_segment_tree ST(time);
  ST.range_update(0, n, 0, 0);
  for (int i = 0; i < q; i++) {
    int T = get<0>(query[i]);
    if (T == 1) {
      int t = get<1>(query[i]);
      int s = get<2>(query[i]);
      int R = (*speed.upper_bound(t)).first;
      int p = (*prev(speed.lower_bound(t))).second;
      ST.range_update(t, R, s, ST[t] - s * time[t]);
      ST.range_add(R, n, (time[R] - time[t]) * (s - p));
      speed[t] = s;
    }
    if (T == 2) {
      int t = get<1>(query[i]);
      int s = (*prev(speed.lower_bound(t))).second;
      int R = (*speed.upper_bound(t)).first;
      int p = speed[t];
      ST.range_update(t, R, s, ST[t] - s * time[t]);
      ST.range_add(R, n, (time[R] - time[t]) * (s - p));
      speed.erase(t);
    }
    if (T == 3) {
      int l = get<1>(query[i]);
      int r = get<2>(query[i]);
      int v = get<3>(query[i]);
      bool add = false;
      if (!speed.count(l)) {
        add = true;
        int t = l;
        int s = 0;
        int R = (*speed.upper_bound(t)).first;
        int p = (*prev(speed.lower_bound(t))).second;
        ST.range_update(t, R, s, ST[t] - s * time[t]);
        ST.range_add(R, n, (time[R] - time[t]) * (s - p));
        speed[t] = s;
      }
      if (v == 0) {
        cout << time[l] << "\n";
      } else if (l == r) {
        cout << -1 << "\n";
      } else {
        long long b = ST[l];
        if (ST.range_min(l, r + 1) > b - v) {
          cout << -1 << "\n";
        } else {
          int tv = l, fv = r + 1;
          while (fv - tv > 1) {
            int mid = (tv + fv) / 2;
            if (ST.range_min(l, mid + 1) > b - v) {
              tv = mid;
            } else {
              fv = mid;
            }
          }
          long long R = ST[tv] - (b - v);
          int s = (*prev(speed.upper_bound(tv))).second;
          cout << time[tv] - (double)R / s << "\n";
        }
      }
      if (add) {
        int t = l;
        int s = (*prev(speed.lower_bound(t))).second;
        int R = (*speed.upper_bound(t)).first;
        int p = 0;
        ST.range_update(t, R, s, ST[t] - s * time[t]);
        ST.range_add(R, n, (time[R] - time[t]) * (s - p));
        speed.erase(t);
      }
    }
  }
}