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;
struct STree {
  vector<int64_t> sum;
  vector<int64_t> mn;
  vector<int> cnt;
  int sz;
  void build(int n) {
    sz = 1;
    while (sz < n) {
      sz *= 2;
    }
    sum.assign(sz * 2, 0);
    mn.assign(sz * 2, 0);
    cnt.assign(sz * 2, 0);
  }
  int xl, xr;
  int64_t x;
  int64_t _getSum(int v, int l, int r) {
    if (xl <= l && r <= xr) {
      return sum[v];
    } else if (r < xl || xr < l) {
      return 0;
    } else {
      int m = (l + r) / 2;
      return _getSum(v * 2, l, m) + _getSum(v * 2 + 1, m + 1, r);
    }
  }
  int64_t getSum(int l, int r) {
    xl = l;
    xr = r;
    return _getSum(1, 0, sz - 1);
  }
  void _setX(int v, int l, int r) {
    if (l == r) {
      sum[v] = x;
      mn[v] = x;
      cnt[v] += xr;
      ;
    } else {
      int m = (l + r) / 2;
      if (xl <= m) {
        _setX(v * 2, l, m);
      } else {
        _setX(v * 2 + 1, m + 1, r);
      }
      sum[v] = sum[v * 2] + sum[v * 2 + 1];
      mn[v] = min(mn[v * 2], mn[v * 2 + 1] + sum[v * 2]);
      cnt[v] += xr;
    }
  }
  void setX(int pos, int64_t val, int zp) {
    xl = pos;
    xr = zp;
    x = val;
    _setX(1, 0, sz - 1);
  }
  int _getPos(int v, int l, int r) {
    if (r < xl || mn[v] > x) {
      return -1;
    } else if (l == r) {
      return l;
    } else {
      int m = (l + r) / 2;
      int res = _getPos(v * 2, l, m);
      if (res == -1) {
        x -= sum[v * 2];
        res = _getPos(v * 2 + 1, m + 1, r);
        x += sum[v * 2];
      }
      return res;
    }
  }
  int getPos(int l, int64_t val) {
    xl = l;
    x = val;
    return _getPos(1, 0, sz - 1);
  }
  int _getMaxZp(int v, int l, int r) {
    if (cnt[v] == 0 || xr < l) {
      return -1;
    } else if (l == r) {
      return l;
    } else {
      int m = (l + r) / 2;
      int res = _getMaxZp(v * 2 + 1, m + 1, r);
      if (res == -1) {
        res = _getMaxZp(v * 2, l, m);
      }
      return res;
    }
  }
  int getMaxZp(int r) {
    xr = r;
    return _getMaxZp(1, 0, sz - 1);
  }
  int _getMinZp(int v, int l, int r) {
    if (cnt[v] == 0 || r < xl) {
      return -1;
    } else if (l == r) {
      return l;
    } else {
      int m = (l + r) / 2;
      int res = _getMinZp(v * 2, l, m);
      if (res == -1) {
        res = _getMinZp(v * 2 + 1, m + 1, r);
      }
      return res;
    }
  }
  int getMinZp(int l) {
    xl = l;
    return _getMinZp(1, 0, sz - 1);
  }
  void debug(int v, int l, int r) {
    cout << v << ' ' << l << ' ' << r << " | " << mn[v] << ' ' << sum[v] << ' '
         << cnt[v] << endl;
    if (l != r) {
      int m = (l + r) / 2;
      debug(v * 2, l, m);
      debug(v * 2 + 1, m + 1, r);
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  vector<int> qe(q);
  vector<pair<int, int>> add;
  vector<int> rm;
  vector<pair<pair<int, int>, int>> md;
  set<int> times;
  for (int i = 0; i < q; ++i) {
    cin >> qe[i];
    if (qe[i] == 1) {
      int t, s;
      cin >> t >> s;
      times.insert(t);
      add.push_back({t, s});
    } else if (qe[i] == 2) {
      int t;
      cin >> t;
      rm.push_back(t);
    } else {
      int l, r, v;
      cin >> l >> r >> v;
      times.insert(l);
      times.insert(r);
      md.push_back({{l, r}, v});
    }
  }
  int cur = 0;
  vector<int> uncom;
  map<int, int> compress;
  for (int v : times) {
    compress[v] = cur;
    ++cur;
    uncom.push_back(v);
  }
  STree s;
  s.build(cur);
  vector<int> states(cur, 2e+9);
  int p1 = 0, p2 = 0, p3 = 0;
  cout << fixed << setprecision(10);
  double dans = 0;
  for (int i = 0; i < q; ++i) {
    if (qe[i] == 1) {
      int ct = compress[add[p1].first];
      states[ct] = add[p1].second;
      int nx = s.getMinZp(ct);
      int pr = s.getMaxZp(ct);
      int64_t x = 2e+9 * 1ll * add[p1].second;
      if (nx != -1) {
        x = add[p1].second * 1ll * (uncom[nx] - add[p1].first);
      }
      s.setX(ct, x, 1);
      if (pr != -1) {
        x = states[pr] * 1ll * (add[p1].first - uncom[pr]);
        s.setX(pr, x, 0);
      }
      ++p1;
    } else if (qe[i] == 2) {
      int ct = compress[rm[p2]];
      states[ct] = 2e+9;
      s.setX(ct, 0, -1);
      int nx = s.getMinZp(ct);
      int pr = s.getMaxZp(ct);
      if (pr != -1) {
        int64_t x = (long long)(2e+9) * 1ll * states[pr];
        if (nx != -1) {
          x = states[pr] * 1ll * (uncom[nx] - uncom[pr]);
        }
        s.setX(pr, x, 0);
      }
      ++p2;
    } else {
      int l, r;
      int64_t v;
      l = md[p3].first.first;
      r = md[p3].first.second;
      v = md[p3].second;
      double ans;
      if (v == 0) {
        ans = l;
      } else {
        int ps = s.getPos(compress[l], -v + s.getSum(0, compress[l] - 1));
        if (ps == -1) {
        }
        if (ps == -1 || ps >= compress[r]) {
          ans = -1;
        } else {
          int64_t sm = s.getSum(compress[l], ps - 1);
          v += sm;
          ans = uncom[ps];
          if (states[ps] >= 0 || states[ps] * 1ll * (r - uncom[ps]) + v > 0) {
            ans = -1;
          } else {
            ans -= v * 1.0 / states[ps];
          }
        }
      }
      cout << ans << '\n';
      dans = ans;
      ++p3;
    }
  }
  return 0;
}