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;
template <typename T>
inline void chkmin(T &x, T y) {
  if (y < x) x = y;
}
template <typename T>
inline void chkmax(T &x, T y) {
  if (y > x) x = y;
}
const int SZ = 1 << 13;
char buff[SZ], *pos = buff + SZ - 1;
inline long long read() {
  long long x = 0;
  int f = 1,
      c = (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos);
  for (; !isdigit(c);
       c = (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos))
    if (c == '-') f = -f;
  for (; isdigit(c);
       c = (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos))
    x = (x << 3) + (x << 1) + (c ^ 48);
  return x * f;
}
const int N = 1 << 18;
long long sum[N << 1], speed[N << 1], mn[N << 1], lazy[N << 1], mul[N << 1];
void init() {
  for (int i = 0; i < (int)(N << 1); ++i)
    sum[i] = speed[i] = mn[i] = mul[i] = 0, lazy[i] = -1e18;
}
void pd(int i) {
  if (lazy[i] != -1e18) {
    speed[i << 1] = speed[i << 1 | 1] = lazy[i];
    sum[i << 1] = lazy[i] * mul[i << 1];
    sum[i << 1 | 1] = lazy[i] * mul[i << 1 | 1];
    mn[i << 1] = mn[i << 1 | 1] = min(0LL, sum[i << 1]);
    lazy[i << 1] = lazy[i << 1 | 1] = lazy[i];
    lazy[i] = -1e18;
  }
}
void upd(int a, int b, int i, int l, int r, int v) {
  if (l <= a && b <= r) {
    lazy[i] = v;
    speed[i] = lazy[i];
    sum[i] = lazy[i] * mul[i];
    mn[i] = min(0LL, sum[i]);
    return;
  }
  if (r <= a || b <= l) return;
  pd(i);
  int md = (a + b) >> 1;
  upd(a, md, i << 1, l, r, v);
  upd(md, b, i << 1 | 1, l, r, v);
  sum[i] = sum[i << 1] + sum[i << 1 | 1];
  mn[i] = min(mn[i << 1], sum[i << 1] + mn[i << 1 | 1]);
}
long long qry(int a, int b, int i, int l, int r) {
  if (l <= a && b <= r) return sum[i];
  if (r <= a || b <= l) return 0;
  pd(i);
  int md = (a + b) >> 1;
  long long L = qry(a, md, i << 1, l, r);
  long long R = qry(md, b, i << 1 | 1, l, r);
  return L + R;
}
struct Ans {
  long long sum, mn;
  Ans() {}
  Ans(long long a, long long b) : sum(a), mn(b) {}
};
Ans qrymn(int a, int b, int i, int l, int r) {
  if (l <= a && b <= r) return Ans(sum[i], mn[i]);
  if (r <= a || b <= l) return Ans(0, 0);
  pd(i);
  int md = (a + b) >> 1;
  Ans L = qrymn(a, md, i << 1, l, r);
  Ans R = qrymn(md, b, i << 1 | 1, l, r);
  return Ans(L.sum + R.sum, min(L.mn, L.sum + R.mn));
}
long long qrys(int a, int b, int i, int x) {
  if (a + 1 == b) return speed[i];
  pd(i);
  int md = (a + b) >> 1;
  if (x < md) return qrys(a, md, i << 1, x);
  return qrys(md, b, i << 1 | 1, x);
}
struct P {
  int t, s;
  P() {}
  P(int a, int b) : t(a), s(b) {}
  bool operator<(const P &x) const { return t < x.t; }
};
int vt[N], svt;
int qtp[N], qa[N], qb[N], qc[N];
set<P> events;
int main() {
  int q = read();
  for (int i = 0; i < (int)(q); ++i) {
    qtp[i] = read();
    if (qtp[i] == 1) {
      qa[i] = read();
      qb[i] = read();
      vt[svt++] = qa[i];
    }
    if (qtp[i] == 2) {
      qa[i] = read();
    }
    if (qtp[i] == 3) {
      qa[i] = read();
      qb[i] = read();
      qc[i] = read();
      vt[svt++] = qa[i];
      vt[svt++] = qb[i];
    }
  }
  vt[svt++] = 0;
  vt[svt++] = 1e9;
  sort(vt, vt + svt);
  svt = unique(vt, vt + svt) - vt;
  init();
  for (int i = 0; i < (int)(svt - 1); ++i) mul[i + N] = vt[i + 1] - vt[i];
  for (int i = N - 1; i; --i) mul[i] = mul[i << 1] + mul[i << 1 | 1];
  for (int i = 0; i < (int)(q); ++i) {
    if (qtp[i] == 1) {
      int t = lower_bound(vt, vt + svt, qa[i]) - vt;
      int s = qb[i];
      set<P>::iterator it = events.lower_bound(P(t, -1e9));
      int nxt = svt - 1;
      if (it != events.end()) nxt = it->t;
      events.insert(P(t, s));
      upd(0, N, 1, t, nxt, s);
    }
    if (qtp[i] == 2) {
      int t = lower_bound(vt, vt + svt, qa[i]) - vt;
      set<P>::iterator it = events.lower_bound(P(t, -1e9));
      it = events.erase(it);
      int nxt = 1e9;
      if (it != events.end()) nxt = it->t;
      int lst = 0;
      if (it != events.begin()) {
        --it;
        lst = it->t;
      }
      int s = qrys(0, N, 1, lst);
      upd(0, N, 1, t, nxt, s);
    }
    if (qtp[i] == 3) {
      int L = lower_bound(vt, vt + svt, qa[i]) - vt;
      int R = lower_bound(vt, vt + svt, qb[i]) - vt;
      int v = qc[i];
      set<P>::iterator it = events.lower_bound(P(L, -1e9));
      double ans = -1;
      if (!v)
        ans = qa[i];
      else if (it != events.end() && it->t <= R) {
        L = it->t;
        if (qrymn(0, N, 1, L, R).mn + v <= 0) {
          int lb = L, rb = R;
          while (lb < rb) {
            int md = lb + rb >> 1;
            if (qrymn(0, N, 1, L, md).mn + v <= 0)
              rb = md;
            else
              lb = md + 1;
          }
          --lb;
          long long lft = v + qry(0, N, 1, L, lb);
          long long nws = qrys(0, N, 1, lb);
          ans = vt[lb] - 1.0 * lft / nws;
        }
      }
      printf("%.7f\n", ans);
    }
  }
  return 0;
}