Dr. Vanik is well known professor of Mathematics. The class is special in which there are 2N rows and 2N columns. There are some students in his class who have complained about his teaching to Dean. So Dean has send a group of Inspectors to his class, They are about to reach anytime.
eg.
@ @ @ # # #
@ @ @ # # #
@ @ @ # # #


 & & &



 & & &



 & & &

This is 2N x 2N class. N = 3
There are four corners in above class with representation (@,#,+,&)
Topleft corner is represented by ‘@’ (size = N x N)
Dr. Vanik knows that they will ask questions to students at topleft corner (N x N) because they are close to entrance of the class.Since he is LOL … he will flip any row or any column any number of times and wants best possible students in topleft corner. He knows intellgence score of each student , Help him to aggregate best possible students in that corner, and print sum of intelligence score of each student.