Bajtori

No attempts yetTime limit1sMemory limit128 MB

Problem

Recently the Japanese puzzle Bajtori has become very popular in Bajtocja. The game board consists of nn squares, and on each square two integers are written: a red number and a green number. The player must choose a subset of the squares so that the weight of the chosen set is as large as possible.

The weight of a set is computed as follows. First, add together the green numbers of all chosen squares and square that sum. Then add together the red numbers of all chosen squares and square that value as well. The weight of the set is the sum of these two squares.

Bajtazar loves Bajtori, but after solving a puzzle he can never tell whether his result is the best possible, so he has asked you for help. Write a program that, for a given puzzle, computes the maximum weight that can be obtained.

Input

The first line contains a natural number nn (1n30000)(1 \le n \le 30000), the number of squares in the puzzle. Each of the next nn lines describes one square. Line i+1i+1 contains the red number cc and the green number zz (30000c,z30000)(-30000 \le c, z \le 30000) of the ii-th square, separated by a single space.

Output

Print a single natural number: the maximum weight obtainable in the puzzle given on the input.