Tommy has just finished college and is looking for his first job. Living close to his friends matters to him, but he wants to live as far from his parents as he can.
You are given where each of Tommy's n friends lives and, for each friend, the largest distance Tommy is willing to live away from that friend. His parents live at the origin (0,0) of the coordinate plane.
The coordinates (px,py) of Tommy's home must satisfy (px−xi)2+(py−yi)2≤di for every friend i. Among the points that satisfy this, find the one farthest from the origin and report that distance. At least one point satisfying the conditions always exists.
Input
The input consists of a single test case.
The first line contains the number of Tommy's friends, n (1≤n≤50). Each of the next n lines contains integers x, y (−1000≤x,y≤1000) and d (1≤d≤1000), separated by spaces. Here (x,y) is where the friend lives and d is the largest distance Tommy is willing to live away from that friend.
Output
Print on a single line the largest distance Tommy can live from his parents while meeting the condition of every friend. Round the value and print exactly three digits after the decimal point.