You are given a N x N square matrix of integers where each cell represents the amount of gold in it. You need to travel from the top left cell to the bottom right cell, and back, maximizing the amount of gold you collect as you pass by the cell following some constraints given below 

You cannot use squares on the leading diagonal of the matrix (Apart from the top left and the bottom right cells.)

When travelling to the bottom right corner from the top left corner, you may only move rightwards or downwards, but never cross the main diagonal.

Similarly, while travelling back to the top left corner from the bottom right corner, you may move only leftwards or upwards, but never cross the main diagonal.

Input / Output

The first line contains an integer N denoting the number of rows and columns in the grid.

Then follows N lines where each line contains N integers, where each line denotes the row and each number in each line denotes the column.

Output the maximum gold you can collect, from top left cell to the bottom right cell and back, under the given constraints.

SAMPLE INPUT
3
4 10 6
1 1 5
-5 6 8

SAMPLE OUTPUT
39

Explanation

There is exactly one path available. The solution is 4 + 10 + 6 + 5 + 8 + 6 -5 + 1 + 4=39.
#maximum gold path - Ani's solution
def main():
    n=int(raw_input())
    a=[]
    for x in range(0,n):
        a.append(["0"] * n)
    i=0
    while i<n:
        st=raw_input()
        l=st.split(' ')
        j=0
        while j<n:
            l[j]=int(l[j])
            j+=1
        j=0
        while j<n:
            a[i][j]=l[j]
            j+=1
        i+=1
    fc=[]
    for x in range(0,n):
        fc.append(["0"] * n)
    for i in range(n):
        for j in range(n):
            fc[i][j]=-999999
    fc[0][0]=a[0][0]
    j=1
    while j<n:
        fc[0][j]=fc[0][j-1]+a[0][j]
        j+=1
    i=1
    while i<n-1:
        j=i+1
        while j<n:
            fc[i][j]=max(fc[i-1][j],fc[i][j-1])+a[i][j]
            j+=1
        i+=1
    fc[n-1][n-1]=max(fc[n-2][n-1],fc[n-1][n-2])+a[n-1][n-1]
    out1=fc[n-1][n-1]
    #print out1
    for i in range(0,n):
        for j in range(i,n):
            t=a[i][j]
            a[i][j]=a[j][i]
            a[j][i]=t
    for i in range(n):
        for j in range(n):
            fc[i][j]=-999999
    fc[0][0]=a[0][0]
    j=1
    while j<n:
        fc[0][j]=fc[0][j-1]+a[0][j]
        j+=1
    i=1
    while i<n-1:
        j=i+1
        while j<n:
            fc[i][j]=max(fc[i-1][j],fc[i][j-1])+a[i][j]
            j+=1
        i+=1
    fc[n-1][n-1]=max(fc[n-2][n-1],fc[n-1][n-2])
    out2=fc[n-1][n-1]
    print str(out1+out2)
main()