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 long long INF = 0x3f3f3f3f3f3f3f3f;
vector<pair<pair<int, int>, pair<int, int> > > q;
vector<int> all;
int get_id(int x) {
  return lower_bound(all.begin(), all.end(), x) - all.begin();
}
struct Segment_tree {
  struct Node {
    long long sum, minj;
    long long lazy;
    Node() { sum = 0, minj = 0, lazy = 0; }
  } T[1600010];
  void pushup(int now) {
    T[now].sum = T[now << 1].sum + T[now << 1 | 1].sum;
    T[now].minj = min(T[now << 1].minj, T[now << 1 | 1].minj + T[now << 1].sum);
  }
  Node merge(Node a, Node b) {
    Node ans;
    ans.sum = a.sum + b.sum, ans.minj = min(a.minj, a.sum + b.minj);
    return ans;
  }
  void pushdown(int now, int l, int r) {
    int mid = l + r >> 1;
    if (T[now].lazy == INF) return;
    long long v = T[now].lazy;
    T[now].lazy = INF;
    T[now << 1].sum = v * (all[mid + 1] - all[l]), T[now << 1].lazy = v;
    T[now << 1 | 1].sum = v * (all[r + 1] - all[mid + 1]),
                 T[now << 1 | 1].lazy = v;
    T[now << 1].minj = v >= 0 ? v * (all[l + 1] - all[l]) : T[now << 1].sum;
    T[now << 1 | 1].minj =
        v >= 0 ? v * (all[mid + 2] - all[mid + 1]) : T[now << 1 | 1].sum;
  }
  void Build(int now, int l, int r) {
    T[now].lazy = INF;
    if (l == r) {
      T[now].sum = 0, T[now].minj = 0;
      return;
    }
    int mid = l + r >> 1;
    Build(now << 1, l, mid), Build(now << 1 | 1, mid + 1, r);
    pushup(now);
  }
  void Update(int now, int l, int r, int L, int R, long long v) {
    if (l == L && r == R) {
      T[now].sum = (all[r + 1] - all[l]) * v;
      T[now].minj = v >= 0 ? (all[l + 1] - all[l]) * v : T[now].sum;
      T[now].lazy = v;
      return;
    }
    pushdown(now, l, r);
    int mid = l + r >> 1;
    if (R <= mid)
      Update(now << 1, l, mid, L, R, v);
    else if (L > mid)
      Update(now << 1 | 1, mid + 1, r, L, R, v);
    else
      Update(now << 1, l, mid, L, mid, v),
          Update(now << 1 | 1, mid + 1, r, mid + 1, R, v);
    pushup(now);
  }
  Node Query(int now, int l, int r, int L, int R) {
    if (L > R) return Node();
    if (l == L && r == R) return T[now];
    pushdown(now, l, r);
    int mid = l + r >> 1;
    if (R <= mid) return Query(now << 1, l, mid, L, R);
    if (L > mid) return Query(now << 1 | 1, mid + 1, r, L, R);
    return merge(Query(now << 1, l, mid, L, mid),
                 Query(now << 1 | 1, mid + 1, r, mid + 1, R));
  }
} seg1;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int op;
    scanf("%d", &op);
    pair<pair<int, int>, pair<int, int> > x;
    x.first.first = op;
    if (op == 1)
      scanf("%d%d", &x.second.first, &x.second.second),
          all.push_back(x.second.first);
    else if (op == 2)
      scanf("%d", &x.first.second), all.push_back(x.first.second);
    else
      scanf("%d%d%d", &x.second.first, &x.second.second, &x.first.second),
          all.push_back(x.second.first), all.push_back(x.second.second);
    q.push_back(x);
  }
  sort(all.begin(), all.end()),
      all.resize(unique(all.begin(), all.end()) - all.begin());
  int m = all.size() - 2;
  if (m >= 0) seg1.Build(1, 0, m);
  set<int> now;
  for (int i = 0; i < n; i++) {
    int op = q[i].first.first;
    if (op == 1)
      q[i].second.first = get_id(q[i].second.first);
    else if (op == 2)
      q[i].first.second = get_id(q[i].first.second);
    else
      q[i].second.first = get_id(q[i].second.first),
      q[i].second.second = get_id(q[i].second.second);
    if (op == 1) {
      int t = q[i].second.first, s = q[i].second.second;
      if (t == all.size() - 1) continue;
      set<int>::iterator it = now.upper_bound(t);
      int last = it == now.end() ? all.size() - 1 : *it;
      seg1.Update(1, 0, m, t, last - 1, s);
      now.insert(t);
    } else if (op == 2) {
      int t = q[i].first.second;
      if (t == all.size() - 1) continue;
      set<int>::iterator it = now.lower_bound(t);
      if (it == now.end() || *it != t) continue;
      it++;
      int last = it == now.end() ? all.size() - 1 : *it;
      it--;
      int first = 0;
      long long v = 0;
      if (it != now.begin()) {
        it--, first = *it;
        v = seg1.Query(1, 0, m, first, first).sum /
            (all[first + 1] - all[first]);
      }
      seg1.Update(1, 0, m, first, last - 1, v);
      now.erase(t);
    } else {
      int l = q[i].second.first, r = q[i].second.second, v = q[i].first.second;
      set<int>::iterator it = now.lower_bound(l);
      int from = -1, to = all.size() - 2;
      long long val = -1;
      int pos, le, ri;
      long long sum, k;
      if (it != now.end()) to = *it - 1;
      if (it != now.begin()) {
        it--, from = *it;
        val = seg1.Query(1, 0, m, from, from).sum / (all[from + 1] - all[from]);
        seg1.Update(1, 0, m, from, to, 0);
      }
      if (v == 0) {
        printf("%d\n", all[l]);
        goto END;
      }
      if (l == r) {
        printf("-1\n");
        goto END;
      }
      if (seg1.Query(1, 0, m, l, r - 1).minj > -v) {
        printf("-1\n");
        goto END;
      }
      le = l, ri = r - 1;
      while (le < ri) {
        int mid = le + ri >> 1;
        long long x = seg1.Query(1, 0, m, l, mid).minj;
        if (x > -v)
          le = mid + 1;
        else
          ri = mid;
      }
      pos = le;
      sum = seg1.Query(1, 0, m, l, pos - 1).sum;
      k = seg1.Query(1, 0, m, pos, pos).sum / (all[pos + 1] - all[pos]);
      printf("%.9lf\n", 1.0 * (-v - sum) / k + all[pos]);
    END:;
      if (~from) seg1.Update(1, 0, m, from, to, val);
    }
  }
  return 0;
}