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")
#pragma GCC target("sse3", "sse2", "sse")
#pragma GCC target("avx", "sse4", "sse4.1", "sse4.2", "ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline", "fast-math", "unroll-loops", \
                     "no-stack-protector")
using namespace std;
template <typename Iter>
ostream& _out(ostream& s, Iter b, Iter e) {
  s << "[";
  for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
  s << "]";
  return s;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> p) {
  return out << '(' << p.first << ", " << p.second << ')';
}
template <class T1, class T2>
istream& operator>>(istream& in, pair<T1, T2>& p) {
  return in >> p.first >> p.second;
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& c) {
  return _out(s, c.begin(), c.end());
}
template <typename T, size_t N>
ostream& operator<<(ostream& s, const array<T, N>& c) {
  return _out(s, c.begin(), c.end());
}
inline char readchar() {
  const int64_t S = 1 << 20;
  static char buf[S], *p = buf, *q = buf;
  if (p == q && (q = (p = buf) + fread(buf, 1, S, stdin)) == buf) return EOF;
  return *p++;
}
inline void input(int64_t& _x) {
  _x = 0;
  int64_t _tmp = 1;
  char _tc = readchar();
  while (_tc < '0' || _tc > '9') _tc = readchar();
  while (_tc >= '0' && _tc <= '9')
    _x = (_x << 1) + (_x << 3) + (_tc - 48), _tc = readchar();
}
inline void output(int64_t _x) {
  char _buff[20];
  int64_t _f = 0;
  if (_x == 0) putchar('0');
  while (_x > 0) {
    _buff[_f++] = _x % 10 + '0';
    _x /= 10;
  }
  for (_f -= 1; _f >= 0; _f--) putchar(_buff[_f]);
  putchar('\n');
}
inline int64_t ran() {
  static int64_t x = 71222217;
  return x = (x * 0xdefaced + 1) & INT_MAX;
}
struct Q {
  int64_t a = 0;
  int64_t b = 1;
  Q& operator+(int64_t x) {
    a += (int64_t)x * b;
    return *this;
  }
  bool operator>(int64_t x) { return (b > 0) == (a > (int64_t)b * x); }
  bool operator>=(int64_t x) { return (b > 0) == (a >= (int64_t)b * x); }
  bool operator<(int64_t x) { return (b > 0) == (a < (int64_t)b * x); }
  friend ostream& operator<<(ostream& out, Q x) {
    return out << (long double)x.a / x.b;
  }
  Q(int64_t aa = 0, int64_t bb = 1) {
    a = aa, b = bb;
    if (b < 0) b = -b, a = -a;
  }
};
struct node {
  node *L = 0, *R = 0;
  int64_t a;
  int64_t b;
  int64_t l, r, alt = 0, pri;
  int64_t mins = LLONG_MAX;
  node(int64_t l, int64_t r, int64_t a, int64_t b) : l(l), r(r), a(a), b(b) {
    pri = ran();
    up();
  }
  void upda(int64_t x) { mins += x, b += x, alt += x; }
  void down() {
    if (L) L->upda(alt);
    if (R) R->upda(alt);
    alt = 0;
  }
  void up() {
    mins = min(b, val());
    if (L) mins = min(mins, L->mins);
    if (R) mins = min(mins, R->mins);
  }
  tuple<node*, node*, node*> split(int64_t i) {
    down();
    if (i < l) {
      auto [a, b, c] = L->split(i);
      L = c;
      up();
      return {a, b, this};
    } else if (i >= r) {
      auto [a, b, c] = R->split(i);
      R = a;
      up();
      return {this, b, c};
    } else {
      auto a = L, b = R;
      L = R = 0;
      up();
      return {a, this, b};
    }
  }
  static node* merge(node* a, node* b) {
    if (!a) return b;
    if (!b) return a;
    if (a->pri < b->pri) {
      a->down();
      a->R = merge(a->R, b);
      a->up();
      return a;
    } else {
      b->down();
      b->L = merge(a, b->L);
      b->up();
      return b;
    }
  }
  node* last() { return R ? down(), R->last() : this; }
  node* first() { return L ? down(), L->first() : this; }
  static node* merge(vector<node*> a) {
    node* n = 0;
    for (auto i : a) {
      n = merge(n, i);
    }
    return n;
  }
  Q find(int64_t x, int64_t q = 1) {
    down();
    if (L && L->mins <= x) return L->find(x, 0);
    if (val() <= x) return inverse(x);
    if (R) return R->find(x, q);
    if (!q) exit(9);
    throw -1;
  }
  int64_t setlast(int64_t x) {
    if (R) {
      down();
      auto a = R->setlast(x);
      up();
      return a;
    } else
      return down(), r = x, up(), val();
  }
  pair<pair<int64_t, int64_t>, pair<int64_t, int64_t>> show() {
    return make_pair(make_pair(l, r), make_pair(a, b));
  }
  ostream& print(ostream& out) {
    down();
    if (L) L->print(out);
    out << show() << " ";
    if (R) R->print(out);
    return out;
  }
  int64_t val(int64_t x = -1) {
    if (x < 0) x = r;
    return (int64_t)a * (x - l) + b;
  }
  Q inverse(int64_t y) {
    if (a) return Q(y - b, a) + l;
    return Q(l);
  }
}* root = new node(0, 1000100000, 0, 0);
ostream& operator<<(ostream& out, node* n) {
  if (!n) return out << "NULL";
  return n->print(out);
}
vector<int64_t> u, v, uu, vv;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  ;
  int64_t q;
  cin >> q;
  cout << setprecision(20) << fixed;
  while (q--) {
    int64_t a;
    cin >> a;
    if (a == 1) {
      int64_t t, s;
      cin >> t >> s;
      while (!root)
        ;
      auto [l, m, r] = root->split(t);
      while (!m)
        ;
      int64_t prev = m->val();
      int64_t mr = m->r;
      m->r = t;
      m->up();
      node* x = new node(t, mr, s, m->val());
      if (r) r->upda(x->val() - prev);
      root = node::merge({l, m, x, r});
    }
    if (a == 2) {
      int64_t t;
      cin >> t;
      while (!root)
        ;
      auto [l, m, r] = root->split(t);
      while (!l)
        ;
      while (!m)
        ;
      while (m->l != t)
        ;
      auto newval = l->setlast(m->r);
      if (r) r->upda(newval - m->val());
      root = node::merge({l, r});
      delete m;
    }
    if (a == 3) {
      int64_t t, rr, v;
      cin >> t >> rr >> v;
      if (!v) {
        cout << t << endl;
        continue;
      }
      while (!root)
        ;
      auto [l, m, r] = root->split(t);
      try {
        if (m->l == t) r = node::merge({m, r}), m = 0;
        if (!r) throw -1;
        int64_t start = r->first()->b - v;
        auto ans = r->find(start);
        while (ans < t)
          ;
        if (ans > rr) throw -3;
        cout << ans << endl;
      } catch (signed i) {
        cout << "-1" << endl;
      }
      root = node::merge({l, m, r});
    }
  }
}