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;
struct info {
  int op, t, s, l, r, v;
} a[100007];
int b[100007], s[100007], e[100007 * 4], mn[100007 * 4];
long long pre[100007 * 4], sum[100007 * 4], tag[100007 * 4];
int find(int l, int r, int x) {
  int res = r;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (b[mid] >= x)
      res = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  return res;
}
int lst(int k, int l, int r, int x) {
  if (r <= x)
    if (e[k])
      if (l == r)
        return l;
      else {
        int mid = (l + r) >> 1;
        if (e[k * 2 + 1])
          return lst(k * 2 + 1, mid + 1, r, x);
        else
          return lst(k * 2, l, mid, x);
      }
    else
      return -1;
  int mid = (l + r) >> 1;
  if (x > mid) {
    int tmp = lst(k * 2 + 1, mid + 1, r, x);
    if (tmp != -1) return tmp;
  }
  return lst(k * 2, l, mid, x);
}
int nxt(int k, int l, int r, int x) {
  if (x <= l)
    if (e[k])
      if (l == r)
        return l;
      else {
        int mid = (l + r) >> 1;
        if (e[k * 2])
          return nxt(k * 2, l, mid, x);
        else
          return nxt(k * 2 + 1, mid + 1, r, x);
      }
    else
      return -1;
  int mid = (l + r) >> 1;
  if (x <= mid) {
    int tmp = nxt(k * 2, l, mid, x);
    if (tmp != -1) return tmp;
  }
  return nxt(k * 2 + 1, mid + 1, r, x);
}
void put(int k, int l, int r, int x) {
  if (l == r) {
    e[k] = x > 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (abs(x) <= mid)
    put(k * 2, l, mid, x);
  else
    put(k * 2 + 1, mid + 1, r, x);
  e[k] = e[k * 2] | e[k * 2 + 1];
}
void init(int k, int l, int r) {
  mn[k] = l;
  if (l == r) return;
  int mid = (l + r) >> 1;
  init(k * 2, l, mid);
  init(k * 2 + 1, mid + 1, r);
}
void up(int k) {
  if (pre[k * 2] < sum[k * 2] + pre[k * 2 + 1])
    mn[k] = mn[k * 2], pre[k] = pre[k * 2];
  else
    mn[k] = mn[k * 2 + 1], pre[k] = sum[k * 2] + pre[k * 2 + 1];
  sum[k] = sum[k * 2] + sum[k * 2 + 1];
}
void push(int k, int l, int mid, int r) {
  sum[k * 2] += tag[k] * (b[mid + 1] - b[l]);
  if (sum[k * 2] > 0)
    mn[k * 2] = l, pre[k * 2] = 0;
  else
    mn[k * 2] = mid + 1, pre[k * 2] = sum[k * 2];
  tag[k * 2] += tag[k];
  sum[k * 2 + 1] += tag[k] * (b[r + 1] - b[mid + 1]);
  if (sum[k * 2 + 1] > 0)
    mn[k * 2 + 1] = mid + 1, pre[k * 2 + 1] = 0;
  else
    mn[k * 2 + 1] = r + 1, pre[k * 2 + 1] = sum[k * 2 + 1];
  tag[k * 2 + 1] += tag[k];
  tag[k] = 0;
}
void upd(int k, int l, int r, int L, int R, int delta) {
  if (L <= l && r <= R) {
    sum[k] += 1LL * delta * (b[r + 1] - b[l]);
    if (sum[k] > 0)
      mn[k] = l, pre[k] = 0;
    else
      mn[k] = r + 1, pre[k] = sum[k];
    tag[k] += delta;
    return;
  }
  int mid = (l + r) >> 1;
  if (tag[k]) push(k, l, mid, r);
  if (L <= mid) upd(k * 2, l, mid, L, R, delta);
  if (R > mid) upd(k * 2 + 1, mid + 1, r, L, R, delta);
  up(k);
}
long long base;
int pos(int k, int l, int r, int L) {
  if (L <= l) {
    if (pre[k] <= base)
      if (l == r)
        return l + 1;
      else {
        int mid = (l + r) >> 1;
        if (tag[k]) push(k, l, mid, r);
        if (pre[k * 2] <= base)
          return pos(k * 2, l, mid, L);
        else {
          base -= sum[k * 2];
          return pos(k * 2 + 1, mid + 1, r, L);
        }
      }
    else {
      base -= sum[k];
      return -1;
    }
  }
  int mid = (l + r) >> 1;
  if (tag[k]) push(k, l, mid, r);
  if (L <= mid) {
    int tmp = pos(k * 2, l, mid, L);
    if (tmp != -1) return tmp;
  }
  return pos(k * 2 + 1, mid + 1, r, L);
}
long long get(int k, int l, int r, int L, int R) {
  if (L <= l && r <= R) return sum[k];
  int mid = (l + r) >> 1;
  if (tag[k]) push(k, l, mid, r);
  long long res = 0;
  if (L <= mid) res += get(k * 2, l, mid, L, R);
  if (R > mid) res += get(k * 2 + 1, mid + 1, r, L, R);
  return res;
}
int main() {
  int q, n = 0;
  scanf("%d", &q);
  b[++n] = 0, b[++n] = 1000000001;
  for (int i = 1; i <= q; ++i) {
    scanf("%d", &a[i].op);
    if (a[i].op == 1) scanf("%d%d", &a[i].t, &a[i].s), b[++n] = a[i].t;
    if (a[i].op == 2) scanf("%d", &a[i].t);
    if (a[i].op == 3) scanf("%d%d%d", &a[i].l, &a[i].r, &a[i].v);
  }
  sort(b + 1, b + n + 1);
  n = unique(b + 1, b + n + 1) - b - 1;
  put(1, 1, n, 1), put(1, 1, n, n);
  init(1, 1, n - 1);
  for (int i = 1; i <= q; ++i) {
    if (a[i].op == 1) {
      int x = find(1, n, a[i].t);
      int l = lst(1, 1, n, x), r = nxt(1, 1, n, x + 1);
      put(1, 1, n, x);
      upd(1, 1, n - 1, x, r - 1, a[i].s - s[l]);
      s[x] = a[i].s;
    }
    if (a[i].op == 2) {
      int x = find(1, n, a[i].t);
      int l = lst(1, 1, n, x - 1), r = nxt(1, 1, n, x + 1);
      put(1, 1, n, -x);
      upd(1, 1, n - 1, x, r - 1, s[l] - s[x]);
    }
    if (a[i].op == 3)
      if (!a[i].v)
        printf("%d\n", a[i].l);
      else {
        int x = find(1, n, a[i].l);
        x = nxt(1, 1, n, x);
        base = -a[i].v;
        int y = pos(1, 1, n - 1, x);
        if (y == -1)
          puts("-1");
        else {
          int l = lst(1, 1, n, y - 1);
          base = a[i].v + get(1, 1, n - 1, x, l - 1);
          double ans = (double)base / (-s[l]) + b[l];
          if (ans > (double)a[i].r)
            puts("-1");
          else
            printf("%.8f\n", ans);
        }
      }
  }
}