A little bear Koma likes honey very much. One day, Koma finds a storehouse full of honey. The storehouse has M entrances and exits, is very complicated like a maze. But Koma understands the structure of the storehouse which it is K downwards repetitions of N*M grid, there are some obstacles and the other grids has a honey pot, M entrances are at the top sides of top grid cells and M exits are at the bottom sides of bottom grid cells.
Koma decides to tour in the storehouse following rules.
1. Koma enters the storehouse through one of the entrances.
2. Koma can move by one of 4 adjacent directions, cannot go through the obstacles and no grid can be visited more than once.
3. Koma can eat a honey pot on his position.
4. Koma can go out through one of the exits.
Koma wants to eat as much honey as possible and he wants to know maximum number of honey pot he can eat when he enters by ith entrance and go out by jth exit and number of that tour.