Time

10:35:14
11 Feb 2012
ACM-ICPC Thailand Southern Region Programming Contest 2011
Left: 4 hours 25 minutes
End: 11.02.2012 15:00
Leader: Informatimukas
Five for week 22
Left: 11 hours 25 minutes
End: 11.02.2012 22:00
Leader: NuM
Version for print

Mouse and corns

prb15

   In the Indian temple the floor has rectangular form filled with identical square tiles 1õ1. Each tile contains from 0 to k (k30000) corns. A mouse runs out from a left lower corner and go to the exit in right upper corner.

   Mouse can go only right or forward, collecting all the corns from the tiles on which it resides.

   Find the route, where mouse can take as much corn as possible.


Specifications

   Input

   The first line contains m and n – the floor size (1m, n100). Next we have m lines, begining from up, which have n numbers in each – it is amount of corns on the floor.

   Output

   Print the route of mouse in format: RRFFFRF (F – step forward, R – step right).


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 8.33333
Complexity: 39% 360/590
Classes: Dynamic programming

Example

Example input

2 3
3 2 4
1 5 1

Example output

RFR


← Rabbit-failure Problems Dragon →