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;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MAXN = 100100;
const int inf = (int)1e9 + 1000;
const long long infll = (long long)1e18 + 1000;
int getRandom() { return uniform_int_distribution<int>(-inf, inf)(rng); }
struct Node {
  int time, speed, pr;
  int tL, tR, speedR;
  long long sum, minSum;
  int l, r;
};
Node tree[MAXN];
int cnt = 1;
int getNode() { return cnt++; }
void update(int v) {
  if (!v) return;
  int l = tree[v].l, r = tree[v].r;
  tree[v].tL = tree[v].tR = tree[v].time;
  tree[v].speedR = tree[v].speed;
  tree[v].sum = 0;
  tree[v].minSum = 0;
  long long gap1, gap2;
  if (l) {
    tree[v].tL = tree[l].tL;
    gap1 = (long long)(tree[v].time - tree[l].tR) * tree[l].speedR;
    tree[v].sum += tree[l].sum + gap1;
    tree[v].minSum = min(tree[v].minSum, min(tree[l].minSum, tree[v].sum));
  }
  if (r) {
    tree[v].tR = tree[r].tR;
    tree[v].speedR = tree[r].speedR;
    gap2 = (long long)(tree[r].tL - tree[v].time) * tree[v].speed;
    tree[v].sum += gap2 + tree[r].sum;
    if (!l)
      tree[v].minSum = min(tree[v].minSum, min(gap2, gap2 + tree[r].minSum));
  }
  if (l && r)
    tree[v].minSum =
        min(tree[v].minSum, tree[l].sum + gap1 + gap2 + tree[r].minSum);
  tree[v].minSum = min(tree[v].minSum, tree[v].sum);
}
void split(int t, int &L, int &R, int val) {
  if (!t) {
    L = R = 0;
  } else if (val >= tree[t].time) {
    split(tree[t].r, tree[t].r, R, val);
    L = t;
  } else {
    split(tree[t].l, L, tree[t].l, val);
    R = t;
  }
  update(t);
}
void merge(int &t, int l, int r) {
  if (!l || !r) {
    t = l ? l : r;
  } else if (tree[l].pr > tree[r].pr) {
    merge(tree[l].r, tree[l].r, r);
    t = l;
  } else {
    merge(tree[r].l, l, tree[r].l);
    t = r;
  }
  update(t);
}
void insert(int &t, int it) {
  if (!t) {
    t = it;
  } else if (tree[it].pr > tree[t].pr) {
    split(t, tree[it].l, tree[it].r, tree[it].time);
    t = it;
  } else {
    insert(tree[it].time >= tree[t].time ? tree[t].r : tree[t].l, it);
  }
  update(t);
}
void erase(int &t, int val) {
  if (!t)
    return;
  else if (tree[t].time == val) {
    merge(t, tree[t].l, tree[t].r);
  } else {
    erase(val > tree[t].time ? tree[t].r : tree[t].l, val);
  }
  update(t);
}
double query(int t, long long v) {
  if (tree[t].minSum + v > 0) return -1;
  int l = tree[t].l, r = tree[t].r;
  if (l) {
    if (v + tree[l].minSum <= 0) return query(l, v);
    long long gap1 = (long long)tree[l].speedR * (tree[t].time - tree[l].tR);
    if (v + tree[l].sum + gap1 <= 0)
      return (double)(v + tree[l].sum) / -tree[l].speedR + tree[l].tR;
    v += tree[l].sum + gap1;
  }
  if (r) {
    long long gap2 = (long long)tree[t].speed * (tree[r].tL - tree[t].time);
    if (v + gap2 <= 0) return (double)(v) / -tree[t].speed + tree[t].time;
    v += gap2;
    return query(r, v);
  }
  return -1;
}
double query(int &t, int a, int b, int v) {
  int l, r;
  if (v == 0) return a;
  split(t, l, r, a - 1);
  double ret;
  ret = query(r, v);
  merge(t, l, r);
  return ret - 1e-9 < b ? ret : -1;
}
int q;
void load() { scanf("%d", &q); }
void solve() {
  int t = 0;
  auto INSERT = [&](int time, int speed) -> void {
    int it = getNode();
    tree[it].time = time;
    tree[it].speed = speed;
    tree[it].pr = getRandom();
    insert(t, it);
  };
  INSERT(0, 0);
  INSERT(inf, 0);
  while (q--) {
    int a, b, c, d;
    scanf("%d", &a);
    if (a == 1) {
      scanf("%d%d", &b, &c);
      INSERT(b, c);
    } else if (a == 2) {
      scanf("%d", &b);
      erase(t, b);
    } else {
      scanf("%d%d%d", &b, &c, &d);
      printf("%.10lf\n", query(t, b, c, d));
    }
  }
}
int main() {
  load();
  solve();
  return 0;
}