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());
uniform_int_distribution<int> distr;
int mrand() { return distr(rng); }
struct Node {
  int key, prior;
  long long cap;
  long long min, finish;
  int id;
  int left, right;
  int leftmost, rightmost;
  Node(int _key, long long _cap, int _id) : key(_key), cap(_cap), id(_id) {
    prior = mrand();
    min = finish = 0;
    left = right = 0;
    leftmost = rightmost = id;
  }
  Node(){};
  void show() { printf("%d %d %lld %lld %lld\n", id, key, cap, min, finish); }
  void recalc();
  void dfs();
};
const int N = (int)1e5 + 5;
int sz = 1;
Node treap[2 * N];
int build(int key, int cap) {
  treap[sz] = Node(key, cap, sz);
  return sz++;
}
long long get_min(int T) { return T ? treap[T].min : 0; }
long long get_finish(int T) { return T ? treap[T].finish : 0; }
void Node::recalc() {
  leftmost = (left ? treap[left].leftmost : id);
  rightmost = (right ? treap[right].rightmost : id);
  long long Tmin = get_min(left);
  long long Tfinish = get_finish(left);
  if (left)
    Tfinish += (key - treap[treap[left].rightmost].key) *
               treap[treap[left].rightmost].cap;
  Tmin = std::min(Tmin, Tfinish);
  if (right) Tfinish += (treap[treap[right].leftmost].key - key) * cap;
  Tmin = std::min(Tmin, Tfinish + get_min(right));
  Tfinish += get_finish(right);
  Tmin = std::min(Tmin, Tfinish);
  min = Tmin;
  finish = Tfinish;
}
void Node::dfs() {
  show();
  if (left) printf("%d->left\n", id), treap[left].dfs();
  if (right) printf("%d->right\n", id), treap[right].dfs();
}
void recalc(int T) {
  if (!T) return;
  treap[T].recalc();
}
int merge(int T1, int T2) {
  if (!T1) return T2;
  if (!T2) return T1;
  if (treap[T1].prior > treap[T2].prior) {
    treap[T2].left = merge(T1, treap[T2].left);
    recalc(T2);
    return T2;
  } else {
    treap[T1].right = merge(treap[T1].right, T2);
    recalc(T1);
    return T1;
  }
}
void split(int T, int key, int& T1, int& T2) {
  if (!T) {
    T1 = T2 = 0;
    return;
  }
  if (key < treap[T].key) {
    split(treap[T].left, key, T1, T2);
    treap[T].left = T2;
    T2 = T;
  } else {
    split(treap[T].right, key, T1, T2);
    treap[T].right = T1;
    T1 = T;
  }
  recalc(T);
}
void insert(int& T, int key, int val) {
  int T1, T2;
  split(T, key - 1, T1, T2);
  T = merge(merge(T1, build(key, val)), T2);
}
void erase(int& T, int key) {
  int T1, T2, T3;
  split(T, key - 1, T1, T2);
  split(T2, key, T2, T3);
  T = merge(T1, T3);
}
double calc(long long start, long long time, long long cap) {
  if (start == 0) return time;
  if (cap >= 0) return -1;
  return time - double(start) / cap;
}
double get_ans(int T, long long start) {
  if (!T) return -1;
  while (true) {
    if (start + treap[T].min > 0) {
      return calc(start + treap[T].finish, treap[treap[T].rightmost].key,
                  treap[treap[T].rightmost].cap);
    }
    double tm, sp;
    if (treap[T].left) {
      if (start + treap[treap[T].left].min <= 0) {
        T = treap[T].left;
        continue;
      }
      start += get_finish(treap[T].left);
      tm = treap[treap[treap[T].left].rightmost].key;
      sp = treap[treap[treap[T].left].rightmost].cap;
      if (start + (treap[T].key - tm) * sp <= 0) {
        return calc(start, tm, sp);
      }
      start += (treap[T].key - tm) * sp;
    }
    if (treap[T].right) {
      tm = treap[treap[treap[T].right].leftmost].key;
      sp = treap[T].cap;
      if (start + (tm - treap[T].key) * sp <= 0) {
        return calc(start, treap[T].key, sp);
      }
      start += (tm - treap[T].key) * sp;
      T = treap[T].right;
    }
  }
}
void dfsT(int T) {
  if (!T) return;
  printf("\n\n");
  treap[T].dfs();
  printf("\n\n");
}
int main() {
  int q;
  scanf("%d", &q);
  int T = 0;
  for (int i = 0; i < q; ++i) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int t, cap;
      scanf("%d %d", &t, &cap);
      insert(T, t, cap);
    }
    if (type == 2) {
      int t;
      scanf("%d", &t);
      erase(T, t);
    }
    if (type == 3) {
      int l, r, start;
      scanf("%d %d %d", &l, &r, &start);
      if (start == 0) {
        printf("%d\n", l);
        continue;
      }
      int T1, T2, T3;
      split(T, l - 1, T1, T2);
      split(T2, r, T2, T3);
      double ans = get_ans(T2, start);
      if (ans < 0 || ans > r + 1e-9)
        printf("-1\n");
      else
        printf("%.15f\n", ans);
      T = merge(merge(T1, T2), T3);
    }
  }
}