The Fair Nut got stacked in planar world. He should solve this task to get out.

You are given n rectangles with vertexes in (0, 0), (x_i, 0), (x_i, y_i), (0, y_i). For each rectangle, you are also given a number a_i. Choose some of them that the area of union minus sum of a_i of the chosen ones is maximum.

It is guaranteed that there are no nested rectangles.

Nut has no idea how to find the answer, so he asked for your help.

Input

The first line contains one integer n (1 ≤ n ≤ 10^6) — the number of rectangles.

Each of the next n lines contains three integers x_i, y_i and a_i (1 ≤ x_i, y_i ≤ 10^9, 0 ≤ a_i ≤ x_i ⋅ y_i).

It is guaranteed that there are no nested rectangles.

Output

In a single line print the answer to the problem — the maximum value which you can achieve.

Examples

Input


3
4 4 8
1 5 0
5 2 10


Output


9

Input


4
6 2 4
1 6 2
2 4 3
5 3 8


Output


10

Note

In the first example, the right answer can be achieved by choosing the first and the second rectangles.

In the second example, the right answer can also be achieved by choosing the first and the second rectangles.
import java.io.*;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class e526 {
	
    public static void main(String[] args) {
    	FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		
        int N = sc.nextInt();
		
		List<tup> pq = new ArrayList<>();
		while(N --> 0) {
			pq.add(new tup(sc.nextInt(), sc.nextInt(), sc.nextLong()));
		}
		Collections.sort(pq, new tup());
		
		ArrayDeque<Line> deq = new ArrayDeque<>();

		// Need a case for when its better just to start from scratch
		deq.add(new Line(0, 0));
		
		long max = 0;
		for(int i = 0; i < pq.size(); i++) {
			tup t = pq.get(i);

			if(deq.size() > 0) {
				Line right = deq.pollLast();
				while(deq.size() > 0 && right.valueAt(t.b) <= deq.peekLast().valueAt(t.b)) {
					right = deq.pollLast();
				}
				deq.addLast(right);
			}

			long value = t.a * t.b - t.c + deq.peekLast().valueAt(t.b);
			Line line = new Line(-t.a, value);
			
			if(deq.size() > 0) {
				Line left = deq.pollFirst();
				while(deq.size() > 0 && line.intersectionAt(deq.peekFirst()) >= left.intersectionAt(deq.peekFirst())) {
					left = deq.pollFirst();
				}
				deq.addFirst(left);
			}
			deq.addFirst(line);
			
			max = Math.max(max, value);
		}
		
		out.println(max);
		out.close();
    }
		
	static class Line {
		long m;
		long b;
		public Line(long M, long B) {
			m = M; b = B;
		}
		
		public long valueAt(long x) {
			return m * x + b;
		}
		
		public double intersectionAt(Line o) { // returns x value of intersection
			return ((double)o.b - b) / (m - o.m);
		}
	}
	
	static class tup implements Comparator<tup>{
		long a, b, c;
		tup(long a,long b,long c){
			this.a=a;
			this.b=b;
			this.c=c;
		}
		public tup() {
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Long.compare(o1.a, o2.a);
		}
		
	}
	
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}