COPYRIGHT : ALBERTUS KELVIN (Jakarta,Indonesia)
================== in a mirror space there are N mini robots which are sent to develop a new robot's kingdom. Each robot has one light detector so if there is a light come or pass through this detector, the robot will be shown in the mirror.
From the planet A, is sent a major robot which can detect some robots (N robots or less than N robots) with it's component namely light source which can be reflected in the mirror in that planet. The function of this major robot is to detect the location of the other robots.
In this case what i mean as the light case is about the reflection in physics. Also we must use the rule : the coming angle must be same as the pass angle.
INPUT The program is inputed by a single line contains two integers R and C, which show us about the row and column value respectively. Follow by R rows which each row contains C characters , where you may use '#' as the mirror, '.' as the free space of the planet, 'T' as the mini robot, and 'R' as the major robot. The location of mini and major robot is free.
OUTPUT The program's output is tell how mini robot can be detected by the major programmed robot. print it in a single line.
IMPORTANT NOTE : That the major robot only can detect the mini robots by the left detection positioning, for more clear info please look at the sample 1.
SAMPLE INPUT 1 9 9
# # # # # # #
. # . # # . . .
T . T . # # # T
. . T . . # T T . . . . . . # . . # . . # T . . . T T
. . . T T # # .
T T # . T . R # T . . . # # . T . .
SAMPLE OUTPUT 1 12 EXPLANATION FIRST the light from major pass through coordinate : 7,6 | 4,3 | 3,2 SECOND the light from major pass through coordinate : 7,5 | reflect by mirror 6,3 | 4,7 | 3,9 THIRD the light from major pass through coordinate : 4,3 | reflect by mirror 2,1 | out of planet FOURTH the light from major pass through coordinate : 6,4 | reflect by mirror 3,1 |out of planet FIFTH the light from major pass through coordinate : 4,3 | out of planet SIXTH the light from major pass through coordinate : 3,2 | out of planet SEVENTH the light from major pass through coordinate : 9,7 | out of planet EIGHTH the light from major pass through coordinate : 8,5 | back reflected by mirror 8,3








