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.
// Main Code at the Bottom
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger; 
public class Main {
	//Fast IO class
    static class FastReader {
        BufferedReader br; 
        StringTokenizer st; 
        public FastReader() {
        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
        	if(!env) {
        		try {
					br=new BufferedReader(new FileReader("src\\input.txt"));
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
        	}
        	else br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
        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; 
        } 
    }     
    static long MOD=1000000000+7;
    //Euclidean Algorithm
    static long gcd(long A,long B){
    	return (B==0)?A:gcd(B,A%B);
    }
    //Modular Exponentiation
    static long fastExpo(long x,long n){
        if(n==0) return 1;
        if((n&1)==0) return fastExpo((x*x)%MOD,n/2)%MOD;
        return ((x%MOD)*fastExpo((x*x)%MOD,(n-1)/2))%MOD;
    }
    //Modular Inverse
    static long inverse(long x) {
    	return fastExpo(x,MOD-2);
    }
    //Prime Number Algorithm
    static boolean isPrime(long n){
        if(n<=1) return false;
        if(n<=3) return true;
        if(n%2==0 || n%3==0) return false;
        for(int i=5;i*i<=n;i+=6) if(n%i==0 || n%(i+2)==0) return false;
        return true;
    }
    //Print array
    static void print1d(int arr[]) {
    	out.println(Arrays.toString(arr));
    }
    static void print2d(int arr[][]) {
    	for(int a[]: arr) out.println(Arrays.toString(a));
    }
    // Pair
    static class pair{
    	long x,y,z;
    	pair(long a,long b,long c){
    		this.x=a;
    		this.y=b;
    		this.z=c;
    	}
    	public boolean equals(Object obj) {
    		if(obj == null || obj.getClass()!= this.getClass()) return false;
            pair p = (pair) obj;
            return (this.x==p.x && this.y==p.y && this.z==p.z);
        }
    	public int hashCode() {
            return Objects.hash(x,y,z);
        }
    }
    static FastReader sc=new FastReader();
    static PrintWriter out=new PrintWriter(System.out);  
    //Main function(The main code starts from here)
    static class line{
    	long m,c;
    	line(long m, long c){
    		this.m=m;
    		this.c=c;
    	}
    	long eval(long x) {
    		return m*x+c;
    	}
    	double intersectX(line l) {
    		return (double)(c-l.c)/(l.m-m);
    	}
    }
    public static void main (String[] args) throws java.lang.Exception {
    	int test=1;
    	//test=sc.nextInt();
    	while(test-->0){
    		//Think before code, it won't hurt
    		int n=sc.nextInt();
    		pair s[]=new pair[n];
    		for(int i=0;i<n;i++) {
    			s[i]=new pair(sc.nextLong(),sc.nextLong(),sc.nextLong());
    		}
    		Arrays.parallelSort(s,(p1,p2)->(int)(p1.x-p2.x));
    		Deque<line> dq=new LinkedList<>();
    		dq.addFirst(new line(0,0));
    		long ans=Long.MIN_VALUE;
    		for(int i=0;i<n;i++) {
    			while(dq.size()>=2) {
    				line r1=dq.pollLast(),r2=dq.peekLast();
    				if(r1.eval(s[i].y)>r2.eval(s[i].y)) {
    					dq.addLast(r1);
    					break;
    				}
    			}
    			long f=dq.peekLast().eval(s[i].y)+s[i].y*s[i].x-s[i].z;
    			ans=Math.max(ans, f);
    			line cur=new line(-s[i].x,f);
    			while(dq.size()>=2) {
    				line l1=dq.pollFirst(),l2=dq.peekFirst();
    				if(cur.intersectX(l1)<l1.intersectX(l2)) {
    					dq.addFirst(l1);
    					break;
    				}
    			}
    			dq.addFirst(cur);
    		}
    		out.println(ans);
    	}
        out.flush();
        out.close();
    }
}