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;
using ll = int64_t;
auto& errStream = cerr;
class CerrDummy {
} cerrDummy;
template <class T>
CerrDummy& operator<<(CerrDummy& cd, const T&) {
  return cd;
}
using charTDummy = char;
using traitsDummy = char_traits<charTDummy>;
CerrDummy& operator<<(CerrDummy& cd,
                      basic_ostream<charTDummy, traitsDummy>&(
                          basic_ostream<charTDummy, traitsDummy>&)) {
  return cd;
}
using pi = pair<ll, ll>;
using vi = vector<ll>;
using ld = long double;
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "{";
  for (ll i = ll(0); i < ll((ll)v.size()); i++) {
    if (i) os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}
template <ll i, class T>
void print_tuple(ostream&, const T&) {}
template <ll i, class T, class H, class... Args>
void print_tuple(ostream& os, const T& t) {
  if (i) os << ",";
  os << get<i>(t);
  print_tuple<i + 1, T, Args...>(os, t);
}
template <class... Args>
ostream& operator<<(ostream& os, const tuple<Args...>& t) {
  os << "(";
  print_tuple<0, tuple<Args...>, Args...>(os, t);
  return os << ")";
}
ll read() {
  ll i;
  scanf("%" SCNd64, &i);
  return i;
}
void printSpace() { printf(" "); }
void printEoln() { printf("\n"); }
void print(ll x, ll suc = 1) {
  printf("%" PRId64, x);
  if (suc == 1) printEoln();
  if (suc == 2) printSpace();
}
template <class T>
void print(const vector<T>& v) {
  for (ll i = ll(0); i < ll(v.size()); i++)
    print(v[i], i == ll(v.size()) - 1 ? 1 : 2);
}
string readString() {
  static char buf[3341000];
  scanf("%s", buf);
  return string(buf);
}
char* readCharArray() {
  static char buf[3341000];
  static ll bufUsed = 0;
  char* ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}
template <class T, class U>
void chmax(T& a, U b) {
  if (a < b) a = b;
}
template <class T, class U>
void chmin(T& a, U b) {
  if (b < a) a = b;
}
template <class T>
T Sq(const T& t) {
  return t * t;
}
void Yes(bool ex = true) {
  cout << "YES" << endl;
  if (ex) exit(0);
}
void No(bool ex = true) {
  cout << "NO" << endl;
  if (ex) exit(0);
}
const ll infLL = LLONG_MAX / 3;
const ll inf = infLL;
constexpr ll TEN(ll n) { return n == 0 ? 1 : TEN(n - 1) * 10; }
template <class T>
vector<T> Uniqued(const vector<T>& vv) {
  auto v(vv);
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  return v;
}
template <class T>
void MakeUniqued(vector<T>& v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
const ll unused = -inf;
struct Node {
  ll mn, sum;
};
Node LazyNode(ll lz, ll len) {
  Node res;
  if (lz >= 0)
    res.mn = 0;
  else
    res.mn = lz * len;
  res.sum = lz * len;
  return res;
};
Node Merge(const Node& x, const Node& y) {
  return Node{min(x.mn, x.sum + y.mn), x.sum + y.sum};
}
struct SegTree {
  ll s;
  vi pos, len;
  vi lz;
  vector<Node> ns;
  SegTree(vi pp) {
    pos = pp;
    ll n = pos.size();
    s = 1;
    while (s < n) s *= 2;
    pos.resize(s + 1, pos.back());
    ns.resize(s * 2, Node{0, 0});
    lz.resize(s * 2, unused);
    len.resize(s * 2);
    InitLen(0, s, 1);
  }
  void InitLen(ll l, ll r, ll i) {
    if (i < s) {
      InitLen(l, (l + r) / 2, i * 2);
      InitLen((l + r) / 2, r, i * 2 + 1);
    }
    len[i] = pos[r] - pos[l];
  }
  Node GetNode(ll i) {
    return lz[i] == unused ? ns[i] : LazyNode(lz[i], len[i]);
  }
  void Propagate(ll i) {
    if (lz[i] == unused) return;
    lz[i * 2] = lz[i * 2 + 1] = lz[i];
    ns[i] = LazyNode(lz[i], len[i]);
    lz[i] = unused;
  }
  void Update(ll i) {
    assert(lz[i] == unused);
    ns[i] = Merge(GetNode(i * 2), GetNode(i * 2 + 1));
  }
  void Set(ll b, ll e, ll v, ll l, ll r, ll i) {
    if (e <= l || r <= b) return;
    if (b <= l && r <= e) {
      cerrDummy << i << " " << l << " " << r << " " << v << endl;
      lz[i] = v;
      return;
    }
    Propagate(i);
    Set(b, e, v, l, (l + r) / 2, i * 2);
    Set(b, e, v, (l + r) / 2, r, i * 2 + 1);
    Update(i);
  }
  void Set(ll b, ll e, ll v) {
    cerrDummy << b << " " << e << " " << v << endl;
    Set(b, e, v, 0, s, 1);
  }
  bool Calc(ll b, ll e, ll& v, double& ans, ll l, ll r, ll i) {
    if (e <= l || r <= b) return false;
    if (b <= l && r <= e) {
      Node x = GetNode(i);
      cerrDummy << i << " " << l << " " << r << " " << x.mn << " " << x.sum
                << " " << len[i] << " " << lz[i] << endl;
      if (v + x.mn <= 0) {
        if (i >= s) {
          assert(lz[i] < 0);
          ans = pos[l] + double(v) / (-lz[i]);
        } else {
          Propagate(i);
          if (Calc(b, e, v, ans, l, (l + r) / 2, i * 2)) return true;
          bool w = Calc(b, e, v, ans, (l + r) / 2, r, i * 2 + 1);
          assert(w);
        }
        return true;
      } else {
        v += x.sum;
        return false;
      }
    }
    Propagate(i);
    if (Calc(b, e, v, ans, l, (l + r) / 2, i * 2)) return true;
    if (Calc(b, e, v, ans, (l + r) / 2, r, i * 2 + 1)) return true;
    return false;
  }
  double Calc(ll b, ll e, ll v) {
    cerrDummy << b << " " << e << " " << v << endl;
    double ans = -1;
    Calc(b, e, v, ans, 0, s, 1);
    return ans;
  }
};
struct Query {
  ll t, a, b, c;
};
signed main() {
  ll n = read();
  vector<Query> qs(n);
  const ll Vmin = -1, Vmax = TEN(9) + 1;
  vi pos{Vmin, Vmax};
  for (ll i = ll(0); i < ll(n); i++) {
    ll t = read();
    qs[i].t = t;
    if (t == 1) {
      qs[i].a = read();
      qs[i].b = read();
      pos.push_back(qs[i].a);
    } else if (t == 2) {
      qs[i].a = read();
      pos.push_back(qs[i].a);
    } else if (t == 3) {
      qs[i].a = read();
      qs[i].b = read();
      qs[i].c = read();
      pos.push_back(qs[i].b);
    }
  }
  MakeUniqued(pos);
  const auto idx = [&](ll x) {
    return lower_bound(pos.begin(), pos.end(), x) - pos.begin();
  };
  cerrDummy << pos << endl;
  SegTree seg(pos);
  set<pi> waf;
  waf.insert(pi(idx(Vmin), 0));
  waf.insert(pi(idx(Vmax), 0));
  set<ll> evs;
  for (ll i = ll(0); i < ll(n); i++) {
    if (qs[i].t == 1) {
      ll p = idx(qs[i].a), q = qs[i].b;
      auto itr = waf.insert(pi(p, q)).first;
      seg.Set(p, next(itr)->first, q);
      evs.insert(qs[i].a);
    } else if (qs[i].t == 2) {
      ll p = idx(qs[i].a);
      auto itr = waf.lower_bound(pi(p, -inf));
      itr = waf.erase(itr);
      seg.Set(p, itr->first, prev(itr)->second);
      evs.erase(qs[i].a);
    } else {
      cerrDummy << qs[i].a << " " << qs[i].b << " " << qs[i].c << endl;
      double ans = -1;
      if (qs[i].c == 0) {
        ans = qs[i].a;
      } else {
        auto itr = evs.lower_bound(qs[i].a);
        if (itr != evs.end() && *itr < qs[i].b) {
          ll p = idx(*itr), q = idx(qs[i].b);
          ans = seg.Calc(p, q, qs[i].c);
        }
      }
      if (ans < 0) {
        print(-1);
      } else {
        printf("%.10f\n", ans);
      }
    }
  }
}