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.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class C {
	static PrintWriter out = new PrintWriter(System.out);

	static final boolean debug = false;
	
	static int ar[];
	static int ptr;
	
	public static void main(String[] args) {
		FS in = new FS();
		int MAXT = 1_000_000_005;
		ST2 st = new ST2(65*100000, MAXT);
		
		int Q = in.nextInt();
		ar = new int[100];
		ptr = 0;
		TreeSet<Event> ts = new TreeSet<Event>();
		for(int qq = 0; qq < Q; qq++) {
			int type = in.nextInt();
			if(type == 1) {
				int t = in.nextInt()+1;
				int s = in.nextInt();
				Event e = new Event(t,s);
				Event hi = ts.higher(e);
				ts.add(e);
				
				int flattenTo = (int) (hi == null ? MAXT-1 : hi.t-1);
				if(debug) System.out.println("Add: "+t+" "+flattenTo+" "+s);
				st.flatten(t, flattenTo);
				st.add(t, flattenTo, s);
			}
			if(type == 2) {
				long t = in.nextLong()+1;
				Event e = new Event(t, -1);
				Event lo = ts.lower(e);
				Event me = ts.floor(e);
				Event hi = ts.higher(e);
				
				// Flatten me to hi and fill with prev if exists
				long flattenTo = hi == null ? MAXT-1 : hi.t-1;
				st.flatten((int) me.t, (int) flattenTo);
				
				if(lo != null) {
					st.add((int) lo.t, (int)flattenTo, (int)lo.s);
				}			
				ts.remove(me);
			}
			if(type == 3) {
				long l = in.nextLong();
				long r = in.nextLong();
				long v = in.nextLong();
				Event start = ts.higher(new Event(l,-1));
				if(debug) System.out.println("E: "+start.t);
				if(v == 0) out.println(l);
				else if(start == null || start.t > r) out.println(-1);
				else {
					ptr = 0;
					st.getNodes((int)start.t,(int)r);
					if(debug) System.out.println("Query from "+start.t+" to "+r);
					
					long lookFor = -v;
					double res = -69_69_69_69;
					
					long pSum = 0;
					for(int i = 0; i < ptr; i++) {
						int cur = ar[i];
						if(pSum + st.mps[cur] <= lookFor) {
							// dfs down this node
							res = st.dfs(cur, pSum, lookFor);
							break;
						}
						else {
							pSum += st.sum[cur];
						}
					}
					
					if(res < 0) out.println(-1);
					else out.println(res);
				}
				
			}

		}
		
		out.close();
	}
	
	static class Event implements Comparable<Event> {
		long t, s;
		public Event(long tt, long ss) {
			t=tt;
			s=ss;
		}
		@Override
		public int compareTo(Event o) {
			return Long.compare(t, o.t);
		}
	}
	
	static class ST2 {
		long[] sum,mps;
		int[] lid,l,r,del;
		int next = 2;
		boolean[] reset;
		public ST2(int maxn, int maxr) {
			l = new int[maxn];
			r = new int[maxn];
			lid = new int[maxn];
			del = new int[maxn];
			sum = new long[maxn];
			mps = new long[maxn];
			reset = new boolean[maxn];
			
			l[1] = 0;
			r[1] = maxr;
		}
		
		void add(int ll, int rr, int vv) { add(1, ll, rr, vv);}
		void flatten(int ll, int rr) { flatten(1, ll, rr);}
		
		void add(int i, int ll, int rr, int vv) {
			if(ll <= l[i] && r[i] <= rr) {
				set(i, vv);
				return;
			}
			if(l[i] > rr || r[i] < ll) return;
			make(i);
			prop(i);
			add(lid[i], ll, rr, vv);
			add(lid[i]|1, ll, rr, vv);
			update(i);
		}
		
		void flatten(int i, int ll, int rr) {
			if(ll <= l[i] && r[i] <= rr) {
				clear(i);
				return;
			}
			if(l[i] > rr || r[i] < ll) return;
			make(i);
			prop(i);
			flatten(lid[i], ll, rr);
			flatten(lid[i]|1, ll, rr);
			update(i);
		}
		
		void make(int i) {
			if(lid[i] != 0) return;
			lid[i] = next;
			
			int mid = (l[i]+r[i])>>1;
			
			l[next] = l[i];
			r[next] = mid;		
			next++;
			
			l[next] = mid+1;
			r[next] = r[i];
			next++;
		}
		
		void prop(int i) {
			if(reset[i]) {
				clear(lid[i]);
				clear(lid[i]|1);
				reset[i] = false;;
			}
			if(del[i] != 0) {
				set(lid[i], del[i]); 
				set(lid[i]|1, del[i]);
				del[i] = 0;
			}
		}
		
		void clear(int i) {
			sum[i] = mps[i] = del[i] = 0;
			reset[i] = true;
		}
		
		void set(int i, int vv) {
			sum[i] = (long)vv*(r[i]-l[i]+1);
			mps[i] = (vv > 0 ? vv : sum[i]);
			del[i] = vv;
		}
		
		void update(int i) {
			sum[i] = sum[lid[i]] + sum[lid[i]|1];
			mps[i] = min(mps[lid[i]], sum[lid[i]] + mps[lid[i]|1]); 
		}
		
		void getNodes(int ll, int rr) { getNodes(1, ll, rr);}
		void getNodes(int i, int ll, int rr) {
			if(ll <= l[i] && r[i] <= rr) {
				ar[ptr++] = i;
				return;
			}
			if(l[i] > rr || r[i] < ll) return;
			make(i);
			prop(i);
			getNodes(lid[i], ll, rr);
			getNodes(lid[i]|1, ll, rr);
			update(i);
		}
		
		double dfs(int i, long pSum, long lookFor) {
			if(l[i] == r[i]) {
				long need = lookFor-pSum;
				double time = (need/(double)(sum[i]));
				double res = (l[i]-1) + time;
				if(debug) System.out.println("Here: "+l+" "+pSum+" "+lookFor+"  need = "+need+" sum = "+sum);
				return res;
			}
			else {
				make(i);
				prop(i);
				update(i);
				if(pSum + mps[lid[i]] <= lookFor) return dfs(lid[i], pSum, lookFor);
				return dfs(lid[i]|1, pSum+sum[lid[i]], lookFor);
			}
		}
		
	}
	
//	static class ST {
//		long sum,mps;
//		int l,r,del;
//		boolean reset;
//		ST left, right;
//		public ST(int ll, int rr) {
//			l=ll;
//			r=rr;
//			sum=mps=0;
//		}
//		
//		// We are guarenteed that an ADD will only be called on a range that's all 0s
//		void add(int ll, int rr, int vv) {
//			if(ll <= l && r <= rr) {
//				set(vv);
//				return;
//			}
//			if(l > rr || r < ll) return;
//			make();
//			prop();
//			left.add(ll, rr, vv);
//			right.add(ll, rr, vv);
//			update();
//		}
//		
//		void flatten(int ll, int rr) {
//			if(ll <= l && r <= rr) {
//				clear();
//				return;
//			}
//			if(l > rr || r < ll) return;
//			make();
//			prop();
//			left.flatten(ll, rr);
//			right.flatten(ll, rr);
//			update();
//		}
//		
//		void clear() {
//			sum=mps=del=0;
//			reset = true;
//		}
//		
//		void set(int vv) {
//			sum = (long)vv*(r-l+1);
//			mps = (vv > 0 ? vv : sum);
//			del = vv;
//		}
//		
//		void update() {
//			sum = left.sum + right.sum;
//			mps = min(left.mps, left.sum + right.mps); 
//		}
//		
//		void prop() {
//			if(reset) {
//				left.clear();
//				right.clear();
//				reset = false;
//			}
//			if(del != 0) {
//				left.set(del); 
//				right.set(del);
//				del = 0;
//			}
//		}
//		
//		void make() {
//			int mid = (l+r)>>1;
//			if(left == null) left = new ST(l, mid);
//			if(right == null) right = new ST(mid+1,r);
//		}
//		
//		
//		void getNodes(int ll, int rr) {
//			if(ll <= l && r <= rr) {
//				ar[ptr++] = this;
//				return;
//			}
//			if(l > rr || r < ll) return;
//			make();
//			prop();
//			left.getNodes(ll, rr);
//			right.getNodes(ll, rr);
//			update();
//		}
//		
//		
//		double dfs(long pSum, long lookFor) {
//			if(l == r) {
//				long need = lookFor-pSum;
//				double time = (need/(double)(sum));
//				double res = (l-1) + time;
//				if(debug) System.out.println("Here: "+l+" "+pSum+" "+lookFor+"  need = "+need+" sum = "+sum);
//				return res;
//			}
//			else {
//				make();
//				prop();
//				update();
//				if(pSum + left.mps <= lookFor) return left.dfs(pSum, lookFor);
//				return right.dfs(pSum+left.sum, lookFor);
//			}
//		}
//		
//		@Override
//		public String toString() {
//			return "(l="+l+" r="+r+" sum="+sum+" mps="+mps+")";
//		}
//	}
	
	static long min(long a, long b) { return a < b ? a : b;}
	static long max(long a, long b) { return a > b ? a : b;}
	
	static class FS{
		BufferedReader br;
		StringTokenizer st;
		public FS() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {
			while(st == null || !st.hasMoreElements()) {
				try {st = new StringTokenizer(br.readLine());}
				catch(Exception e) { throw null;}
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next());}
		double nextDouble() { return Double.parseDouble(next());}
		long nextLong() { return Long.parseLong(next());}
		int[] NIA(int n) {
			int r[] = new int[n];
			for(int i = 0; i < n; i++) r[i] = nextInt();
			return r;
		}
		long[] NLA(int n) {
			long r[] = new long[n];
			for(int i = 0; i < n; i++) r[i] = nextLong();
			return r;
		}
		char[][] grid(int r, int c){
			char res[][] = new char[r][c];
			for(int i = 0; i < r; i++) {
				char l[] = next().toCharArray();
				for(int j = 0; j < c; j++) {
					res[i][j] = l[j];
				}
			}
			return res;
		}
	}
	
}