After hearing about the recent gold discovery in Belgium, you decide to travel to Brussels to make some profits.
Minutes after landing at the Brussels International Airport, you find yourself walking along a lonely road that seems to lead nowhere. Just as you start to reconsider your life choices, you enter a crossroads that separates
Every character on the gold map consists of either d
for dirt and g
for gold. Your task is to output the number of the quadrant that has the most gold.
Input Specification
First line consists of a single integer
The next
Output Specification
The number of the quadrant that will bring you the most gold. Break ties by outputting the quadrant that has both the most gold and the lowest number.
Sample Input
3
ddddgg
ddgddd
dddddd
gggddd
ddddgd
gggggg
Sample Output
3
Explanation
The bottom left quadrant, quadrant
Comments