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;
const int inf = 1e9;
const long long Inf = 1e18;
const int mod = 1;
template <typename T = int>
T gi() {
  T x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
template <typename T>
bool chkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
};
template <typename T>
bool chkmin(T &a, T b) {
  return a > b ? a = b, 1 : 0;
};
int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
int sub(int a, int b) { return a - b < 0 ? a - b + mod : a - b; }
void inc(int &a, int b) { a = (a + b >= mod ? a + b - mod : a + b); }
void dec(int &a, int b) { a = (a - b < 0 ? a - b + mod : a - b); }
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + "," + to_string(p.second) + ")";
}
template <typename T>
string to_string(T v) {
  int fst = 1;
  string ret = "{";
  for (auto x : v) {
    if (!fst) ret += ",";
    fst = 0, ret += to_string(x);
  }
  ret += "}";
  return ret;
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  dbg_out(T...);
}
template <typename T>
int qpow(int a, T b) {
  int ret = 1;
  while (b) {
    if (b & 1) ret = 1ll * ret * a % mod;
    a = 1ll * a * a % mod, b >>= 1;
  }
  return ret;
}
struct data {
  long long vr = 0, mn = 0;
  int l = 0, k = 0;
  data() {}
};
struct treap {
  int rt = 0;
  vector<int> ls, rs, key, sz;
  vector<data> tr, val;
  void reset() {
    rt = 0;
    ls.clear();
    rs.clear();
    key.clear();
    sz.clear();
    tr.clear();
    val.clear();
    ls.push_back(0);
    rs.push_back(0);
    key.push_back(rand());
    sz.push_back(0);
    tr.push_back(data());
    val.push_back(data());
  }
  void apply(int x, long long vr, long long mn) {
    tr[x].vr = vr, tr[x].mn = mn;
    val[x].vr = vr, val[x].mn = mn;
  }
  void pushdown(int x) {}
  data merge(data a, data b) {
    if (a.l == 0) return b;
    if (b.l == 0) return a;
    data ret;
    ret.vr = a.vr + b.vr;
    ret.mn = min(a.mn, a.vr + b.mn);
    ret.l = a.l;
    return ret;
  }
  void pushup(int x) {
    sz[x] = sz[ls[x]] + sz[rs[x]] + 1;
    tr[x] = merge(tr[ls[x]], merge(val[x], tr[rs[x]]));
  }
  int newnode(data v) {
    ls.push_back(0);
    rs.push_back(0);
    tr.push_back(v);
    val.push_back(v);
    key.push_back(rand());
    sz.push_back(1);
    return int(ls.size()) - 1;
  }
  treap() { reset(); }
  int merge(int a, int b) {
    if (!a || !b) return a | b;
    pushdown(a);
    pushdown(b);
    if (key[a] < key[b]) {
      rs[a] = merge(rs[a], b);
      pushup(a);
      return a;
    } else {
      ls[b] = merge(a, ls[b]);
      pushup(b);
      return b;
    }
  }
  pair<int, int> split(int o, int k) {
    if (!o) return make_pair(0, 0);
    pair<int, int> y;
    pushdown(o);
    if (sz[ls[o]] >= k) {
      y = split(ls[o], k);
      ls[o] = y.second;
      pushup(o);
      y.second = o;
    } else {
      y = split(rs[o], k - sz[ls[o]] - 1);
      rs[o] = y.first;
      pushup(o);
      y.first = o;
    }
    return y;
  }
  int getkth(int x, int v) {
    if (!x) return 0;
    return val[x].l > v ? getkth(ls[x], v) : getkth(rs[x], v) + sz[ls[x]] + 1;
  }
  int getkth(int v) { return getkth(rt, v); }
  void insert(int k, data v) {
    pair<int, int> x = split(rt, k - 1);
    int o = newnode(v);
    rt = merge(merge(x.first, o), x.second);
  }
  void insert(data v) { insert(getkth(v.l) + 1, v); }
  void del(int k) {
    pair<int, int> x = split(rt, k - 1);
    pair<int, int> y = split(x.second, 1);
    rt = merge(x.first, y.second);
  }
  template <typename... T>
  void modify(int l, int r, T... v) {
    pair<int, int> x = split(rt, l - 1);
    pair<int, int> y = split(x.second, r - l + 1);
    apply(y.first, v...);
    rt = merge(x.first, merge(y.first, y.second));
  }
  data query(int l, int r) {
    pair<int, int> x = split(rt, l - 1);
    pair<int, int> y = split(x.second, r - l + 1);
    auto ret = tr[y.first];
    rt = merge(x.first, merge(y.first, y.second));
    return ret;
  }
  data findkth(int x) { return query(x, x); }
  data lower_bound(int x) { return findkth(getkth(x - 1) + 1); }
  data pre(int x) { return findkth(getkth(x) - 1); }
  int size() { return int(ls.size()) - 1; }
  double binary(int x, long long v) {
    if (ls[x] && tr[ls[x]].mn <= v) return binary(ls[x], v);
    v -= tr[ls[x]].vr;
    if (val[x].mn <= v) return val[x].l + fabs(1.0 * v / val[x].k);
    v -= val[x].vr;
    if (rs[x] && tr[rs[x]].mn <= v) return binary(rs[x], v);
    return -1;
  }
  void print(int x) {
    if (!x) return;
    cerr << "{"
         << "val[x].vr, val[x].mn, val[x].l, val[x].k"
         << "}:",
        dbg_out(val[x].vr, val[x].mn, val[x].l, val[x].k);
    print(ls[x]), print(rs[x]);
  }
  double binary(int l, int r, long long v) {
    int h = getkth(l - 1) + 1, t = getkth(r);
    if (h > t || v == 0) return v == 0 ? l : -1;
    pair<int, int> x = split(rt, h - 1);
    pair<int, int> y = split(x.second, t - h + 1);
    double ret = binary(y.first, v);
    if (ret > r) ret = -1;
    rt = merge(x.first, merge(y.first, y.second));
    return ret;
  }
} tr;
int q;
int main() {
  q = gi();
  data tmp;
  tr.insert(tmp);
  tmp.l = 1e9;
  tr.insert(tmp);
  while (q--) {
    int op = gi();
    if (op == 1) {
      int t = gi(), s = gi();
      int k = tr.getkth(t);
      data pre = tr.findkth(k), nxt = tr.findkth(k + 1), now;
      long long vr = 1ll * (t - pre.l) * pre.k;
      long long mn = min(0ll, vr);
      tr.modify(k, k, vr, mn);
      now.vr = 1ll * s * (nxt.l - t);
      now.mn = min(0ll, now.vr);
      now.l = t;
      now.k = s;
      tr.insert(now);
    }
    if (op == 2) {
      int t = gi();
      int k = tr.getkth(t);
      data pre = tr.findkth(k - 1), nxt = tr.findkth(k + 1);
      long long vr = 1ll * (nxt.l - pre.l) * pre.k;
      long long mn = min(0ll, vr);
      tr.modify(k - 1, k - 1, vr, mn);
      tr.del(k);
    }
    if (op == 3) {
      int l = gi(), r = gi(), v = gi();
      double ans = tr.binary(l, r, -v);
      if (ans < 0)
        puts("-1");
      else
        printf("%.6lf\n", ans);
    }
  }
  return 0;
}