{"raw_statement":[{"iden":"problem statement","content":"In the $xy$\\-plane, we have $N$ points, each assigned a weight.  \nThe $i$\\-th point has the coordinates $(X_i,Y_i)$ and the weight $C_i$.\nWe will choose four of the $N$ points to form an isosceles trapezoid whose vertices are the chosen points.  \nWhat is the maximum possible total weight of the points chosen here?\nIf it is impossible to form an isosceles trapezoid, print `-1`.\nWe remind you that an isosceles trapezoid is a quadrilateral that satisfies all of the following conditions.\n\n*   It is a trapezoid.\n*   For one of the two parallel sides, the two angles at its ends are equal."},{"iden":"constraints","content":"*   $4 \\leq N \\leq 1000$\n*   $-10^9 \\leq X_i,Y_i \\leq 10^9$\n*   $1 \\leq C_i \\leq 10^9$\n*   $(X_i,Y_i) \\neq (X_j,Y_j)$ if $i \\neq j$.\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$X_1$ $Y_1$ $C_1$\n$X_2$ $Y_2$ $C_2$\n$\\vdots$\n$X_N$ $Y_N$ $C_N$"},{"iden":"sample input 1","content":"5\n0 3 10\n3 3 10\n-1 0 10\n2 0 10000\n4 0 10"},{"iden":"sample output 1","content":"40\n\n![image](https://img.atcoder.jp/ghi/950d55e5491c25b5776d4bec170f313a.png)\nWe can choose Points $1, 2, 3, 5$ to form an isosceles trapezoid, with the points having a total weight of $40$.  \nAny other way to choose points would not form an isosceles trapezoid."},{"iden":"sample input 2","content":"6\n0 1 1\n1 4 20\n2 7 300\n5 6 4000\n4 3 50000\n3 0 600000"},{"iden":"sample output 2","content":"650021\n\n![image](https://img.atcoder.jp/ghi/5b2010c444d75d8220a5b19a356a3ee9.png)\nNote that a square and a rectangle are also isosceles trapezoids."},{"iden":"sample input 3","content":"7\n-3 0 1\n-2 0 1\n-1 0 1\n0 0 1\n1 0 1\n2 0 1\n3 0 1"},{"iden":"sample output 3","content":"\\-1\n\nWe cannot form an isosceles trapezoid."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}