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;
int xju[200005];
map<int, int> liss;
int dy[200005];
int lscnt = 0;
typedef struct n0de {
  n0de *l, *r;
  long long wc;
  long long mn, fi;
  n0de() {
    l = r = 0;
    mn = fi = 0;
    wc = 0x3f3f3f3f3f3f3f3f;
  }
} * node;
inline node newnode() { return new n0de(); }
inline void change(node now, int nl, int nr, int l, int r, long long x) {
  if (!now->l) {
    now->l = newnode();
  }
  if (!now->r) {
    now->r = newnode();
  }
  if (now->wc != 0x3f3f3f3f3f3f3f3f) {
    int m = (nl + nr) >> 1;
    now->l->fi = now->wc * (dy[m + 1] - dy[nl]);
    now->l->mn = (now->l->fi >= 0 ? 0 : now->l->fi);
    now->l->wc = now->wc;
    now->r->fi = now->wc * (dy[nr + 1] - dy[m + 1]);
    now->r->mn = (now->l->fi >= 0 ? 0 : now->r->fi);
    now->r->wc = now->wc;
    now->wc = 0x3f3f3f3f3f3f3f3f;
  }
  if (nl >= l && nr <= r) {
    now->wc = x;
    now->fi = now->wc * (dy[nr + 1] - dy[nl]);
    now->mn = (now->fi >= 0 ? 0 : now->fi);
    return;
  }
  if (nr < l || nl > r) {
    return;
  }
  int m = (nl + nr) >> 1;
  change(now->l, nl, m, l, r, x);
  change(now->r, m + 1, nr, l, r, x);
  now->fi = now->l->fi + now->r->fi;
  now->mn = min(now->l->mn, now->l->fi + now->r->mn);
}
inline pair<long long, long long> chmin(node now, int nl, int nr, int l,
                                        int r) {
  if (l > r) {
    return make_pair(0, 0);
  }
  if (!now->l) {
    now->l = newnode();
  }
  if (!now->r) {
    now->r = newnode();
  }
  if (now->wc != 0x3f3f3f3f3f3f3f3f) {
    int m = (nl + nr) >> 1;
    now->l->fi = now->wc * (dy[m + 1] - dy[nl]);
    now->l->mn = (now->l->fi >= 0 ? 0 : now->l->fi);
    now->l->wc = now->wc;
    now->r->fi = now->wc * (dy[nr + 1] - dy[m + 1]);
    now->r->mn = (now->l->fi >= 0 ? 0 : now->r->fi);
    now->r->wc = now->wc;
    now->wc = 0x3f3f3f3f3f3f3f3f;
  }
  if (nl >= l && nr <= r) {
    return make_pair(now->mn, now->fi);
  }
  if (nr < l || nl > r) {
    return make_pair(0, 0);
  }
  int m = (nl + nr) >> 1;
  pair<long long, long long> x = chmin(now->l, nl, m, l, r);
  pair<long long, long long> y = chmin(now->r, m + 1, nr, l, r);
  return make_pair(min(x.first, x.second + y.first), x.second + y.second);
}
node root;
inline pair<long long, long long> Chmin(int l, int r) {
  if (l > r) {
    return make_pair(0, 0);
  }
  int L = liss[l];
  map<int, int>::iterator rr = liss.upper_bound(r);
  rr--;
  int R = rr->second, rrr = rr->first;
  pair<long long, long long> x = chmin(root, 0, lscnt - 1, L, R - 1);
  pair<long long, long long> y = chmin(root, 0, lscnt - 1, R, R);
  return make_pair(min(x.first, x.second + y.first / xju[R] * (r - rrr)),
                   x.second + y.second / xju[R] * (r - rrr));
}
int q;
set<pair<int, long long> > evs;
int mmm[100005], lll[100005], rrr[100005], sss[100005];
int main() {
  root = newnode();
  evs.insert(make_pair(1000000000, 0));
  evs.insert(make_pair(0, 0));
  scanf("%d", &q);
  liss[0];
  liss[1000000000];
  for (int i = 0; i < q; i++) {
    scanf("%d", &mmm[i]);
    if (mmm[i] == 1) {
      scanf("%d%d", &lll[i], &sss[i]);
      liss[lll[i]];
    } else if (mmm[i] == 2) {
      scanf("%d", &lll[i]);
    } else {
      scanf("%d%d%d", &lll[i], &rrr[i], &sss[i]);
    }
  }
  for (map<int, int>::iterator it = liss.begin(); it != liss.end(); it++) {
    it->second = lscnt;
    dy[lscnt] = it->first;
    if (lscnt) {
      xju[lscnt - 1] = dy[lscnt] - dy[lscnt - 1];
    }
    lscnt++;
  }
  xju[lscnt - 1] = 1;
  for (int I = 0; I < q; I++) {
    int mode = mmm[I];
    if (mode == 1) {
      int t = lll[I], s = sss[I];
      set<pair<int, long long> >::iterator xx =
          evs.upper_bound(make_pair(t, s));
      pair<long long, long long> x = *xx;
      change(root, 0, lscnt - 1, liss[t], liss[x.first] - 1, s);
      evs.insert(make_pair(t, s));
    } else if (mode == 2) {
      int t = lll[I];
      set<pair<int, long long> >::iterator xx =
          evs.upper_bound(make_pair(t, 0x3f3f3f3f3f3f3f3f));
      set<pair<int, long long> >::iterator yy = xx;
      yy--;
      set<pair<int, long long> >::iterator zz = yy;
      zz--;
      pair<long long, long long> x = *xx, z = *zz;
      change(root, 0, lscnt - 1, liss[t], liss[x.first] - 1, z.second);
      evs.erase(yy);
    } else {
      int l = lll[I], r = rrr[I], v = sss[I];
      if (v == 0) {
        printf("%d\n", l);
        continue;
      }
      set<pair<int, long long> >::iterator xxx =
          evs.lower_bound(make_pair(l, -0x3f3f3f3f3f3f3f3f));
      int frm = (*xxx).first;
      pair<long long, long long> fff;
      fff = Chmin(frm, r);
      long long rval = fff.first;
      if (rval + v > 0) {
        puts("-1");
        continue;
      }
      int L = frm, R = r;
      long long lval = 0;
      while (R - L > 1) {
        long long m = (L + R) >> 1;
        pair<long long, long long> fff = Chmin(frm, m);
        long long mnx = fff.first;
        if (mnx + v > 0) {
          L = m;
          lval = fff.second;
        } else {
          R = m;
          rval = fff.second;
        }
      }
      double vv;
      if (rval - lval == 0) {
        vv = L;
      } else {
        vv = 1.00 * (-v - lval) / (rval - lval) + L;
      }
      printf("%.10lf\n", vv);
    }
  }
  return 0;
}