highest-points
Source: hackerearth
Difficulty: EASY

As the league stage of the world cup has come to its end, its time to calculate the highest points earned in the league stage by a team. 
There are many teams playing in the world cup. A team is awarded 3 points for a win, 1 point for a tie and it loses 1 point if they lose a match.  You have received data of N  teams and have been assigned the duty to calculate the highest point earned by a team among the N  teams in the league stage. For each team, data contains three integers – W ( number of wins), T (number of tie), L (number of matches the team lost).  Now, calculate the highest points earned by a team in the league stage among the N teams.
INPUT:
First line contains a integer N, number of teams.
 Next N lines contains three integers separated by space :  W T L , number of wins, tie, lost matches for that ith team. (1 ≤ i ≤ N)
OUTPUT:
print a single integer , highest points earned a team among the N teams.

CONSTRAINS
1 ≤ N ≤ 1000
0 ≤ W,T,L ≤ 100

Disclaimer : All the data are fictional and has no relation and significance with real life.

SAMPLE INPUT
3
3 0 1
2 1 3
1 1 1

SAMPLE OUTPUT
8

Explanation

Team 1 =  (3x3) + (0x1) + (1x-1) = 8
Team 2 = (2x3) + (1x1) + (3x-1) = 4
Team 3 = (1x3)  +  (1x1)  +  (1x-1) = 3
So the highest point earned by any team is 8.


t=int(input())
l,a=[],[]
for e in range(t):
	a=list(map(int,input().split()))
	l.append( (3*a[0]+a[1]-a[2]) )
l.sort()
print(l[t-1])


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
x=eval(input())
d=[]
while x:
	
	a,b,c=list(map(int,input().split()))
	d.append(3*a+b-c)
	x=x-1
print(max(d))


noOfTeams = int(input())

stats = []

for tno in range(1, noOfTeams + 1):
	w,t,l = input().split(" ")
	stats.append(int(w) * 3 + int(t) * 	1 + int(l) * -1)
print(max(stats))	


n=int(input())
maxx=-100000
while n>0:
	a,b,c=list(map(int,input().split()))
	d=3*a+1*b-1*c
	if d>maxx:
		maxx=d
	n-=1
print(maxx)    



noOfTeams = int(input())

stats = []

for tno in range(1, noOfTeams + 1):
	w,t,l = input().split(" ")
	stats.append(int(w) * 3 + int(t) * 	1 + int(l) * -1)
print(max(stats))	


n=eval(input(""))
s=list()
while n>0:
	m=list(map(int,input("").split()))
	s.append((m[0]*3)+(m[1]*1)+(m[2]*(-1)))
	n=n-1
print(max(s))