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;
using ll = long long;
using ld = double;
const int MQ = 1e5 + 100;
const int MV = 1e9 + 100;
int p[MQ << 1], P;
const ld EPS = 1e-4;
bool equ(ld a, ld b) { return fabs(a - b) < EPS; }
struct DT {
 public:
  int l, r;
  ll v, u;
  int z;
  DT() : l(0), r(0), v(0LL), u(0LL), z(MV) {}
  DT(int l, int r) : l(l), r(r), v(0LL), u(0LL), z(MV) {}
  void set(int l, int r) { this->l = l, this->r = r; }
  ld operator[](ll& q) const {
    if (q == 0) return l;
    assert(q + v <= 0);
    return l + static_cast<ld>(q) * (r - l) / (-v);
  }
};
template <int MS = MQ << 3>
struct ST {
 public:
  DT v[MS];
  int s;
  void sv(int n, int d) {
    v[n].v = static_cast<ll>(v[n].r - v[n].l) * d;
    v[n].u = d < 0 ? v[n].v : 0LL;
  }
  void sz(int n, int d) {
    sv(n, d);
    v[n].z = d;
  }
  void down(int n, int l, int r) {
    if (v[n].z == MV) return;
    if (r - l > 1) sz(n << 1, v[n].z), sz(n << 1 | 1, v[n].z);
    v[n].z = MV;
  }
  void up(int n) {
    v[n].v = v[n << 1].v + v[n << 1 | 1].v;
    v[n].u = min(v[n << 1].u, v[n << 1].v + v[n << 1 | 1].u);
  }
  void init(int n, int l, int r) {
    if (r - l > 1) {
      int m = l + ((r - l) >> 1);
      init(n << 1, l, m), init(n << 1 | 1, m, r);
    }
    v[n].set(p[l], p[r]);
  }
  void init(int S) {
    s = S;
    init(1, 0, s);
  }
  void upd(int n, int l, int r, int ql, int qr, int q) {
    if (ql <= l && r <= qr)
      sz(n, q);
    else {
      down(n, l, r);
      int m = l + ((r - l) >> 1);
      if (ql < m) upd(n << 1, l, m, ql, qr, q);
      if (m < qr) upd(n << 1 | 1, m, r, ql, qr, q);
      up(n);
    }
  }
  void upd(int ql, int qr, int q) { upd(1, 0, s, ql, qr, q); }
  ld qry(int n, int l, int r, int ql, int qr, ll& q) {
    down(n, l, r);
    if (ql <= l && r <= qr) {
      if (q + v[n].u > 0) return q += v[n].v, -1.0;
      if (r - l > 1) {
        int m = l + ((r - l) >> 1);
        if (q + v[n << 1].u <= 0)
          return qry(n << 1, l, m, ql, qr, q);
        else
          return qry(n << 1 | 1, m, r, ql, qr, q += v[n << 1].v);
      } else
        return v[n][q];
    } else {
      int m = l + ((r - l) >> 1);
      ld f = -1.0;
      if (ql < m) {
        f = qry(n << 1, l, m, ql, qr, q);
        if (!equ(f, -1.0)) return f;
      }
      if (m < qr) return qry(n << 1 | 1, m, r, ql, qr, q);
      return -1.0;
    }
  }
  ld qry(int ql, int qr, ll& q) { return qry(1, 0, s, ql, qr, q); }
};
ST<> st;
int Q;
int q[MQ][4];
void cmpr() {
  sort(p, p + P);
  P = unique(p, p + P) - p;
  for (int i = 0; i < Q; i++) {
    q[i][1] = lower_bound(p, p + P, q[i][1]) - p;
    if (q[i][0] == 3) q[i][2] = lower_bound(p, p + P, q[i][2]) - p;
  }
  p[P] = MV;
}
using i2 = array<int, 2>;
bool operator<(const i2& a, const i2& b) {
  return a[0] < b[0] || (!(b[0] < a[0]) && a[1] < b[1]);
}
using si = set<i2>;
using sit = si::iterator;
si v;
void ins(int t, int s) {
  sit l = v.insert({t, s}).first;
  st.upd(t, (++l)->at(0), s);
}
void rem(int t) {
  sit p = v.lower_bound({t, -MV}), n = p;
  assert(p->at(0) == t);
  n = v.erase(n), p = n;
  if (p == v.begin())
    st.upd(t, n->at(0), 0);
  else
    st.upd(t, n->at(0), (--p)->at(1));
}
int qry(int l, int r, ll& q) {
  if (q <= 0) return printf("%d\n", p[l]);
  l = v.lower_bound({l, -MV})->at(0);
  if (l >= r) return printf("-1\n"), 0;
  ld x = st.qry(l, r, q);
  if (equ(x, -1))
    printf("-1\n");
  else
    printf("%.15f\n", x);
  return 0;
}
void solve() {
  v.insert({P, -1});
  ll t;
  for (int i = 0; i < Q; i++) {
    int* c = q[i];
    if (c[0] == 1) ins(c[1], c[2]);
    if (c[0] == 2) rem(c[1]);
    if (c[0] == 3) qry(c[1], c[2], t = static_cast<ll>(c[3]));
  }
}
int main() {
  scanf("%d", &Q);
  P = 0;
  for (int i = 0; i < Q; i++) {
    scanf("%d", q[i]);
    if (q[i][0] == 1) scanf("%d%d", q[i] + 1, q[i] + 2), p[P++] = q[i][1];
    if (q[i][0] == 2) scanf("%d", q[i] + 1);
    if (q[i][0] == 3)
      scanf("%d%d%d", q[i] + 1, q[i] + 2, q[i] + 3), p[P++] = q[i][1],
                                                     p[P++] = q[i][2];
  }
  cmpr();
  st.init(P);
  solve();
  return 0;
}