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>
#pragma GCC optimize("Ofast")
using namespace std;
const int N = 1 << 20;
long long lazy[N << 1], val[N << 1], sum[N << 1], mul[N << 1], mn[N << 1],
    mnpos[N << 1];
void pd(int i, int l, int r) {
  if (lazy[i] != -1e18) {
    val[i] = lazy[i];
    sum[i] = lazy[i] * mul[i];
    if (0 <= sum[i])
      mn[i] = 0, mnpos[i] = l;
    else
      mn[i] = sum[i], mnpos[i] = r;
    if (i < N) {
      lazy[i << 1] = lazy[i];
      lazy[i << 1 | 1] = lazy[i];
    }
    lazy[i] = -1e18;
  }
}
void upd(int a, int b, int i, int l, int r, int v) {
  pd(i, a, b);
  if (l <= a && b <= r) {
    lazy[i] = v;
    pd(i, a, b);
    return;
  }
  if (r <= a || b <= l) return;
  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];
  if (mn[i << 1] <= sum[i << 1] + mn[i << 1 | 1])
    mn[i] = mn[i << 1], mnpos[i] = mnpos[i << 1];
  else
    mn[i] = sum[i << 1] + mn[i << 1 | 1], mnpos[i] = mnpos[i << 1 | 1];
}
void upd(int l, int r, int v) { upd(0, N, 1, l, r, v); }
long long qry(int a, int b, int i, int l, int r) {
  pd(i, a, b);
  if (l <= a && b <= r) return sum[i];
  if (r <= a || b <= l) return 0;
  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;
}
long long qry(int l, int r) { return qry(0, N, 1, l, r); }
struct YYY {
  long long sum, mn;
  YYY() {}
  YYY(long long a, long long b) : sum(a), mn(b) {}
};
YYY yyy[N << 1];
void qryyy(int a, int b, int i, int l, int r) {
  pd(i, a, b);
  if (l <= a && b <= r) {
    yyy[i] = YYY(sum[i], mn[i]);
    return;
  }
  if (r <= a || b <= l) {
    yyy[i] = YYY(0, 0);
    return;
  }
  int md = (a + b) >> 1;
  qryyy(a, md, i << 1, l, r);
  qryyy(md, b, i << 1 | 1, l, r);
  yyy[i].sum = yyy[i << 1].sum + yyy[i << 1 | 1].sum;
  if (yyy[i << 1].mn < yyy[i << 1].sum + yyy[i << 1 | 1].mn)
    yyy[i].mn = yyy[i << 1].mn;
  else
    yyy[i].mn = yyy[i << 1].sum + yyy[i << 1 | 1].mn;
}
void qryyy(int l, int r) { qryyy(0, N, 1, l, r); }
int qryans(int a, int b, int i, int l, int r, long long v) {
  pd(i, a, b);
  if (r <= a || b <= l) return -1;
  int md = (a + b) >> 1;
  if (i < N) {
    pd(i << 1, a, md);
    pd(i << 1 | 1, md, b);
    long long lsum, rsum, lmn, rmn;
    if (l <= a && b <= r) {
      lsum = sum[i << 1];
      lmn = mn[i << 1];
      rsum = sum[i << 1 | 1];
      rmn = mn[i << 1 | 1];
    } else {
      lsum = yyy[i << 1].sum;
      lmn = yyy[i << 1].mn;
      rsum = yyy[i << 1 | 1].sum;
      rmn = yyy[i << 1 | 1].mn;
    }
    if (lmn + v <= 0) return qryans(a, md, i << 1, l, r, v);
    if (lsum + rmn + v <= 0) return qryans(md, b, i << 1 | 1, l, r, v + lsum);
    return -1;
  } else
    return mn[i] + v <= 0 ? mnpos[i] : -1;
}
int qryans(int l, int r, int v) { return qryans(0, N, 1, l, r, v); }
long long qrys(int a, int b, int i, int x) {
  pd(i, a, b);
  if (a + 1 == b) return val[i];
  int md = (a + b) >> 1;
  if (x < md) return qrys(a, md, i << 1, x);
  return qrys(md, b, i << 1 | 1, x);
}
long long qrys(int x) { return qrys(0, N, 1, x); }
struct query {
  int tp, A, B, C;
  query() {}
  query(int a, int b, int c, int d) : tp(a), A(b), B(c), C(d) {}
};
vector<query> vquery;
vector<int> vtime;
struct event {
  int t, s;
  event() {}
  event(int a, int b) : t(a), s(b) {}
  bool operator<(const event &x) const { return t < x.t; }
};
set<event> events;
int getId(int tme) {
  return lower_bound(vtime.begin(), vtime.end(), tme) - vtime.begin();
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int tp;
    scanf("%d", &tp);
    if (tp == 1) {
      int t, s;
      scanf("%d%d", &t, &s);
      vquery.push_back(query(tp, t, s, -1));
      vtime.push_back(t);
    }
    if (tp == 2) {
      int t;
      scanf("%d", &t);
      vquery.push_back(query(tp, t, -1, -1));
    }
    if (tp == 3) {
      int l, r, v;
      scanf("%d%d%d", &l, &r, &v);
      vquery.push_back(query(tp, l, r, v));
      vtime.push_back(l);
      vtime.push_back(r);
    }
  }
  vtime.push_back(0);
  vtime.push_back(1e9);
  sort(vtime.begin(), vtime.end());
  vtime.erase(unique(vtime.begin(), vtime.end()), vtime.end());
  for (int i = 0; i < (N << 1); ++i) lazy[i] = -1e18;
  for (int i = 0; i + 1 < vtime.size(); ++i)
    mul[i + N] = vtime[i + 1] - vtime[i];
  for (int i = N - 1; ~i; --i) mul[i] = mul[i << 1] + mul[i << 1 | 1];
  for (int i = 0; i < n; ++i) {
    int tp = vquery[i].tp;
    if (tp == 1) {
      int t = vquery[i].A;
      int s = vquery[i].B;
      set<event>::iterator it, jt;
      events.insert(event(t, s));
      it = events.find(event(t, s));
      int nxt = 1e9;
      jt = it;
      if (jt != events.end()) {
        ++jt;
        if (jt != events.end()) {
          nxt = jt->t;
        }
      }
      int L = getId(t);
      int R = getId(nxt);
      upd(L, R, s);
    }
    if (tp == 2) {
      int t = vquery[i].A;
      set<event>::iterator it, jt, kt;
      it = events.lower_bound(event(t, -1e9));
      int s = it->s;
      it = events.erase(it);
      int lsts = 0;
      jt = it;
      if (jt != events.begin()) {
        --jt;
        lsts = jt->s;
      }
      int nxt = 1e9;
      if (it != events.end()) {
        nxt = it->t;
      }
      int L = getId(t);
      int R = getId(nxt);
      upd(L, R, lsts);
    }
    if (tp == 3) {
      int l = getId(vquery[i].A);
      int r = getId(vquery[i].B);
      int v = vquery[i].C;
      set<event>::iterator it = events.lower_bound(event(vtime[l], -1e9));
      int fst = 1e9;
      if (it != events.end()) fst = it->t;
      fst = getId(fst);
      int fsts = qrys(l);
      upd(l, fst, 0);
      double ans = -1;
      if (!v)
        ans = vtime[l];
      else {
        qryyy(l, r);
        int x = qryans(l, r, v);
        if (~x) {
          --x;
          ans = vtime[x];
          long long lft = qry(l, x);
          long long nws = -qrys(x);
          if (lft + v) ans += 1.0 * (lft + v) / nws;
          if (ans > vtime[r]) ans = -1;
        }
      }
      printf("%.7f\n", ans);
      upd(l, fst, fsts);
    }
  }
  return 0;
}