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 JAVA):

Solution:
import java.io.*;
import java.text.*;
import java.util.*;
import java.math.*;
public class template {
	public static void main(String[] args) throws Exception {
		new template().run();
	}
	TreeSet<Long> times;
	public void run() throws Exception {
		FastScanner f = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = f.nextInt();
		Event[] evnts = new Event[n];
		times = new TreeSet<Long>();
		for(int i = 0; i < n; i++) {
			int t = f.nextInt();
			if(t == 1)
				evnts[i] = new Event(t, f.nextInt(), f.nextInt());
			else if(t == 2)
				evnts[i] = new Event(t, f.nextInt());
			else
				evnts[i] = new Event(t, f.nextInt(), f.nextInt(), f.nextInt());
		}
		HashMap<Long,Integer> t_comp = new HashMap<>();
		long[] tarr = new long[times.size()+1];
		{
			int cnt = 0;
			tarr[cnt++] = -1;
			for(long x : times)
				t_comp.put(tarr[cnt] = x, cnt++);
		}
		TreeMap<Integer,Integer> changes = new TreeMap<Integer,Integer>();
		changes.put(0, 0);
		seg3 = new SegTree(tarr.length+1);
		for(Event e : evnts) {
			if(e.type == 1) {
				int t = t_comp.get((long) e.t);
				Map.Entry<Integer, Integer> pc = changes.lowerEntry(t), nc = changes.higherEntry(t);
				if(nc != null) {
					int pt = pc.getKey();
					long pv = pc.getValue();
					int nt = nc.getKey();
					seg3.addRange(nt, (tarr[nt] - tarr[t]) * (e.s - pv) - (tarr[t] - tarr[pt]) * pv);
					seg3.addRange(t, (tarr[t] - tarr[pt]) * pv);
				} else {
					int pt = pc.getKey();
					long pv = pc.getValue();
					seg3.addRange(t, (tarr[t] - tarr[pt]) * pv);
				}
				changes.put(t, e.s);
			} else if(e.type == 2) {
				int t = t_comp.get((long) e.t);
				int ov = changes.get(t);
				Map.Entry<Integer, Integer> pc = changes.lowerEntry(t), nc = changes.higherEntry(t);				
				if(nc != null) {
					int pt = pc.getKey();
					long pv = pc.getValue();
					int nt = nc.getKey();
					seg3.addRange(nt, (tarr[nt] - tarr[t]) * (pv - ov) + (tarr[t] - tarr[pt]) * pv);
					seg3.addRange(t, -(tarr[t] - tarr[pt]) * pv);
				} else {
					int pt = pc.getKey();
					long pv = pc.getValue();
					seg3.addRange(t, -(tarr[t] - tarr[pt]) * pv);
				}
				changes.remove(t);
			} else {
				int l = e.l, r = e.r;
				long v = e.v;
				if(v <= 0) {
					out.println(l);
					continue;
				}
				int rdt = Arrays.binarySearch(tarr, l);
				if(rdt < 0) rdt = ~rdt;
				Map.Entry<Integer,Integer> rd = changes.ceilingEntry(rdt);
				if(rd == null) {
					out.println(-1);
					continue;
				}
				rdt = rd.getKey();
				v = seg3.getMin(rdt, rdt+1) - v;
				int rut = Arrays.binarySearch(tarr, r);
				if(rut < 0) rut = ~rut;
				Map.Entry<Integer,Integer> ru = changes.floorEntry(rut);
				rut = ru.getKey();
				int ruv = ru.getValue();
				int bsl = rdt, bsr = rut+1;
				while(bsl < bsr) {
					int m = (bsl+bsr)/2;
					if(seg3.getMin(rdt, m+1) <= v) bsr = m;
					else bsl = m+1;
				}
				if(bsl == rut+1) {
					if(ruv >= 0) out.println(-1);
					else {
						int time = changes.floorKey(bsl-1);
						long sv = seg3.getMin(time, time+1);
						long temp = -changes.get(time);
						double ans = tarr[time] + (sv - v)/((double) temp);
						long comp = tarr[time] * temp + sv - v;
						if(comp > r*temp || comp < l*temp) out.println(-1);
						else out.println(ans);
					}
				} else {
					int time = changes.floorKey(bsl-1);
					long sv = seg3.getMin(time, time+1);
					long temp = -changes.get(time);
					double ans = tarr[time] + (sv - v)/((double) temp);
					long comp = tarr[time] * temp + sv - v;
					if(comp > r*temp || comp < l*temp) out.println(-1);
					else out.println(ans);
				}
			}
		}
		out.flush();
	}
	SegTree seg3;
	class SegTree {
		long[] mins, lz;
		int n;
		public SegTree(int n) {
			mins = new long[4*n];
			lz = new long[4*n];
			this.n = n;
		}
		public long getMin(int l, int r) {
			long ans =  min(l, r, 0, n, 0); 
			return ans;
		}
		public void addRange(int l, long v) {
			update(l,n,v,0,n,0);
		}
		public long min(int l, int r, int li, int ri, int i) {
			if(l >= ri || r <= li) return Long.MAX_VALUE;
			if(l <= li && r >= ri) return mins[i] + lz[i];
			if(li != ri-1) {
				lz[2*i+1] += lz[i];
				lz[2*i+2] += lz[i];
			}
			mins[i] += lz[i];
			lz[i] = 0;
			int mi = (li+ri)/2;
			return Math.min(min(l,r,li, mi, 2*i+1), min(l,r,mi,ri,2*i+2));
		}
		public void update(int l, int r, long v, int li, int ri, int i) {
			if(l >= ri || r <= li) return;
			if(l <= li && r >= ri) {
				lz[i] += v;
				return;
			}
			if(li != ri-1) {
				lz[2*i+1] += lz[i];
				lz[2*i+2] += lz[i];
			}
			lz[i] = 0;
			int mi = (li+ri)/2;
			update(l, r, v, li, mi, 2*i+1);
			update(l, r, v, mi, ri, 2*i+2);
			mins[i] = Math.min(mins[2*i+1] + lz[2*i+1], mins[2*i+2] + lz[2*i+2]);
		}
	}
	class Event {
		int type;
		int l, r, v, s, t;
		public Event(int...s) {
			type = s[0];
			if(type == 1) {
				t = s[1];
				this.s = s[2];
				times.add((long) t);
			} else if(type == 2) {
				t = s[1];
				times.add((long) t);
			} else {
				l = s[1];
				r = s[2];
				v = s[3];
			}
		}
	}
    static class FastScanner {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public FastScanner() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
        	return Long.parseLong(next());
        }
        public double nextDouble() {
        	return Double.parseDouble(next());
        }
        public String nextLine() {
        	try {
        		return reader.readLine();
        	} catch(IOException e) {
        		throw new RuntimeException(e);
        	}
        }
    }
}
/*
14
1 7 -460747048
1 12 -693247574
2 7
1 7 -679575641
2 7
3 18 25 5
1 32 -177679178
1 10 -552707677
2 10
1 24 -106259
1 7 -102289583
2 12
3 18 27 1
3 22 43 22
*/