#0003B6

Little Adam

Little Adam lives in city, which contains N subway stations.
Location of each station, you can specify coordinates in a Cartesian system of coordinates: xi, yi, zi. To get from station i to station j, requires p(i,j)=|xi-yj|+|yi-zj|+|zi-xj| milliseconds.
Interestingly, that p(i,i) may be greater than zero and p(i,j) may not be equal to p(j,i).
Find the distance between the most distant stations.
We are interested in two different stations.


InputFirst line contains integer N - number of stations. (2<=N<=10^6).
There are next N lines. Each of them contains three integers xi, yi, zi.
Module of coordinates does not exceed 10^6.

OutputOutput the time in milliseconds between the most distant stations, ie the maximum p(i,j) (i<>j).

Input:
5
1 2 3
3 2 1
2 1 3
3 1 2
1 3 2

Output:
4
Explanation: p(1,5) and p(2,4) equal to 4.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.