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>
#pragma GCC optimize("O3")
using namespace std;
const long long mod7 = 1000000007LL;
inline long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
inline long long add(long long _x, long long _y, long long _mod = mod7) {
  _x += _y;
  return _x >= _mod ? _x - _mod : _x;
}
inline long long sub(long long _x, long long _y, long long _mod = mod7) {
  _x -= _y;
  return _x < 0 ? _x + _mod : _x;
}
inline long long mul(long long _x, long long _y, long long _mod = mod7) {
  _x *= _y;
  return _x >= _mod ? _x % _mod : _x;
}
long long mypow(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 1ll;
  long long _ret = mypow(mul(_a, _a, _mod), _x >> 1, _mod);
  if (_x & 1) _ret = mul(_ret, _a, _mod);
  return _ret;
}
long long mymul(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 0ll;
  long long _ret = mymul(add(_a, _a, _mod), _x >> 1, _mod);
  if (_x & 1) _ret = add(_ret, _a, _mod);
  return _ret;
}
void sleep(double sec = 1021) {
  clock_t s = clock();
  while (clock() - s < CLOCKS_PER_SEC * sec)
    ;
}
int __ = 1, _cs;
const int mxN = 1e5 + 5, bs = 200, bc = (mxN - 1) / bs + 1;
int nq, n;
array<int, 4> q[mxN];
vector<int> v;
long long s[mxN], ms[bc], ts[bc], lz2[bc];
bool lz1[bc];
void pb(int i) {
  if (lz1[i]) {
    for (int l = i * bs; l < min(n - 1, (i + 1) * bs); ++l) s[l] = lz2[i];
    lz1[i] = 0;
  }
}
void ub(int i) {
  ts[i] = ms[i] = 0;
  for (int l = i * bs; l < min(n - 1, (i + 1) * bs); ++l) {
    ts[i] += s[l] * (v[l + 1] - v[l]);
    ms[i] = min(ts[i], ms[i]);
  }
}
void upd(int l, int r, long long x) {
  int bi = l / bs;
  pb(bi);
  for (; l < (bi + 1) * bs && l <= r; ++l) s[l] = x;
  ub(bi++);
  if (l > r) return;
  for (; l + bs <= r; l += bs, ++bi) {
    lz1[bi] = 1;
    lz2[bi] = x;
    ts[bi] = (v[l + bs] - v[l]) * x;
    if (x > 0)
      ms[bi] = 0;
    else
      ms[bi] = ts[bi];
  }
  pb(bi);
  for (; l <= r; ++l) {
    s[l] = x;
  }
  ub(bi);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  v.push_back(0);
  v.push_back(1e9 + 1);
  cin >> nq;
  for (int i = 0; i < nq; ++i) {
    cin >> q[i][0] >> q[i][1];
    if (q[i][0] != 2) cin >> q[i][2];
    if (q[i][0] == 3) cin >> q[i][3];
    if (q[i][0] == 1) v.push_back(q[i][1]);
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  n = v.size();
  for (int i = 0; i < nq; ++i) {
    if (q[i][0] != 3)
      q[i][1] = lower_bound(v.begin(), v.end(), q[i][1]) - v.begin();
  }
  cout << fixed << setprecision(9);
  map<int, int> m{{0, 0}, {n - 1, 0}};
  for (int qi = 0; qi < nq; ++qi) {
    if (q[qi][0] == 1) {
      auto it = m.lower_bound(q[qi][1]);
      upd(q[qi][1], it->first - 1, q[qi][2]);
      m[q[qi][1]] = q[qi][2];
    } else if (q[qi][0] == 2) {
      m.erase(q[qi][1]);
      auto it1 = m.lower_bound(q[qi][1]), it2 = it1--;
      upd(it1->first, it2->first - 1, it1->second);
    } else {
      int li = lower_bound(v.begin(), v.end(), q[qi][1]) - v.begin(),
          ri = lower_bound(v.begin(), v.end(), q[qi][2]) - v.begin() - 1;
      li = m.lower_bound(li)->first;
      int bi = li / bs;
      long long c = q[qi][3];
      if (c <= 0) {
        cout << q[qi][1] << "\n";
        continue;
      }
      if (li > ri) {
        cout << "-1\n";
        continue;
      }
      bool sc = 0;
      pb(bi);
      for (; li < (bi + 1) * bs && li <= ri && !sc; ++li) {
        int df = min(q[qi][2], v[li + 1]) - v[li];
        if (c + df * s[li] <= 0) {
          cout << (long double)-c / s[li] + v[li] << "\n";
          sc = 1;
        }
        c += df * s[li];
      }
      if (sc) continue;
      ++bi;
      for (; li + bs <= ri; li += bs, ++bi) {
        if (c + ms[bi] <= 0) break;
        c += ts[bi];
      }
      pb(bi);
      for (; li <= ri && !sc; ++li) {
        int df = min(q[qi][2], v[li + 1]) - v[li];
        if (c + df * s[li] <= 0) {
          cout << (long double)-c / s[li] + v[li] << "\n";
          sc = 1;
        }
        c += df * s[li];
      }
      if (sc) continue;
      cout << "-1\n";
    }
  }
}