* Line 1: Three space-separated integers N, M, and K.
* Lines 2..N+1: Line i+1 has two space-separated integers,
representing the number of the ports that port i's left and right rivers lead to, respectively.
* Line N+2: M space-separated characters, either 'L' or 'R'. 'L' represents a choice of 'left' and 'R' represents a choice of 'right'.