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;
void optIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
map<int, int> tpoint;
long long revt[200020];
int a[100020], b[100020], c[100020], d[100020];
bool event[200020];
long long change[200020];
long long spd[200020], dif[520];
long long blow[520], bsend[520];
int bcount[520];
void solve() {
  int q;
  cin >> q;
  for (int i = 0; i < q; ++i) {
    cin >> a[i] >> b[i];
    if (a[i] == 1) {
      cin >> c[i];
      tpoint[b[i]] = 0;
    } else if (a[i] == 2) {
      tpoint[b[i]] = 0;
    } else {
      cin >> c[i] >> d[i];
      tpoint[b[i]] = 0;
      tpoint[c[i]] = 0;
    }
  }
  int id = 0;
  for (auto it = tpoint.begin(); it != tpoint.end(); it++) {
    revt[id] = (*it).first;
    (*it).second = id++;
  }
  int blast = (id - 1) / 450;
  set<int> ms;
  ms.insert(1e9);
  for (int i = 0; i < q; ++i) {
    int post = tpoint[b[i]];
    int bi = post / 450;
    if (a[i] <= 2) {
      if (a[i] == 1) {
        event[post] = 1;
        change[post] = c[i];
        bcount[bi]++;
        ms.insert(post);
      } else {
        event[post] = 0;
        change[post] = 0;
        bcount[bi]--;
        ms.erase(post);
      }
      long long speed = 0;
      if (bi > 0) speed = bsend[bi - 1];
      long long sum = 0;
      blow[bi] = 1e18;
      for (int j = bi * 450; j < min(id - 1, (bi + 1) * 450); ++j) {
        if (event[j]) speed = change[j];
        spd[j] = speed;
        sum += speed * (revt[j + 1] - revt[j]);
        blow[bi] = min(sum, blow[bi]);
      }
      bsend[bi] = speed;
      dif[bi] = sum;
      int jj = bi + 1;
      for (int j = bi + 1; j < blast + 1; ++j) {
        if (bcount[j] != 0) break;
        dif[j] = (revt[min((j + 1) * 450, id - 1)] - revt[j * 450]) * speed;
        blow[j] = min(0ll, dif[j]);
        bsend[j] = speed;
        jj = j + 1;
      }
      sum = 0;
      blow[jj] = 1e18;
      for (int j = jj * 450; j < min(id - 1, (jj + 1) * 450); ++j) {
        if (event[j]) speed = change[j];
        spd[j] = speed;
        sum += speed * (revt[j + 1] - revt[j]);
        blow[jj] = min(sum, blow[jj]);
      }
      bsend[jj] = speed;
      dif[jj] = sum;
    } else {
      long long v = d[i];
      if (v == 0) {
        cout << fixed << setprecision(9) << (long double)revt[post] << "\n";
        continue;
      }
      int post2 = tpoint[c[i]];
      int bj = post2 / 450;
      if (ms.find(post) == ms.end()) {
        ms.insert(post);
        auto it = ms.find(post);
        it++;
        int tmp = post;
        post = min((*it), post2);
        bi = post / 450;
        ms.erase(tmp);
      }
      bool stop = 0;
      if (bi == bj) {
        long long speed = 0;
        for (int j = post; j < post2; ++j) {
          if (bcount[bi] == 0)
            speed = bsend[bi];
          else
            speed = spd[j];
          if (v + (revt[j + 1] - revt[j]) * speed <= 0) {
            cout << fixed << setprecision(9)
                 << revt[j] - ((long double)v / speed) << "\n";
            stop = 1;
            break;
          }
          v += (revt[j + 1] - revt[j]) * speed;
        }
        if (stop) continue;
      } else {
        bool stop = 0;
        long long speed = 0;
        for (int j = post; j < (bi + 1) * 450; ++j) {
          if (bcount[bi] == 0)
            speed = bsend[bi];
          else
            speed = spd[j];
          if (v + (revt[j + 1] - revt[j]) * speed <= 0) {
            cout << fixed << setprecision(9)
                 << revt[j] - ((long double)v / speed) << "\n";
            stop = 1;
            break;
          }
          v += (revt[j + 1] - revt[j]) * speed;
        }
        if (stop) continue;
        for (int j = bi + 1; j < bj; ++j) {
          if (v + blow[j] <= 0) {
            long long speed = 0;
            for (int jj = j * 450; jj < (j + 1) * 450; ++jj) {
              if (bcount[j] == 0)
                speed = bsend[j];
              else
                speed = spd[jj];
              if (v + (revt[jj + 1] - revt[jj]) * speed <= 0) {
                cout << fixed << setprecision(9)
                     << revt[jj] - ((long double)v / speed) << "\n";
                stop = 1;
                break;
              }
              v += (revt[jj + 1] - revt[jj]) * speed;
            }
            assert(stop == 1);
            break;
          }
          v += dif[j];
        }
        if (stop) continue;
        speed = 0;
        for (int j = bj * 450; j < post2; ++j) {
          if (bcount[bj] == 0)
            speed = bsend[bj];
          else
            speed = spd[j];
          if (v + (revt[j + 1] - revt[j]) * speed <= 0) {
            cout << fixed << setprecision(9)
                 << revt[j] - ((long double)v / speed) << "\n";
            stop = 1;
            break;
          }
          v += (revt[j + 1] - revt[j]) * speed;
        }
        if (stop) continue;
      }
      cout << fixed << setprecision(9) << (long double)-1 << "\n";
      continue;
    }
  }
}
int main() {
  optIO();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}