Help me untangle these wires! My wires are all tangled!

Isn't it annoying when wires get all tangled up? Well, that just happened to me, so I'd like to to help me untangle them! For your convenience, I've disconnected them all from the device, but they're all still connected to the outlet. Your challenge is to figure out how to untangle them!

Input

The input will consist of spaces, pipes, and Xs (both cases). The input will look something like this:

| | | |
 X  | |
| |  x 
|  X  |
| | | |


A capital X means that the left wire crosses over the right wire, and a lowercase x means the opposite. The first and last lines will always be | | | |.... You may take the input as a comma separated string, an array of strings, etc. The format is not strict, as long as it makes sense and doesn't contain any extra information.

Output

For this challenge, not only do I need to know how long I will take, I need to know exactly what to do. So, output a list of integer pairs with the character R or L, case insensitive, representing which two wires to untangle and which way (R means right over left, and vice versa for L). You need to tell me which way to uncross them; I can't figure that out myself. Output is pretty flexible too, as long as you output all of the integer pairs + character in the correct order and you don't output any extra nonsense text (brackets, commas, etc. are fine). The wires can be zero or one indexed, but the index must start from the left. Note that you must untangle from the bottom, not the top. Output style must be consistent, and please specify how you are outputting if it is not obvious. The case of the character doesn't have be consistent, if that helps at all.

Sample Output

For the example input above, the output would be something like:

2 3 R
3 4 L
1 2 R


The output format here is a newline separated list of space separated values. This is 1-indexed.

Further specifications

It is valid to have X and x stacked vertically over each other in either order. Since I'm lazy, I don't want to switch wires around unnecessarily, so don't output anything for these cases; if I find that, I'll just pull the wires gently to get them straight.

It is also valid to have multiple X and x stacked vertically, and as long as neither wire is involved in other crossings, I don't want any extra moves (because I'm lazy). Thus, if the characters X X x X x x show up in a column without any other crossings, the output should still be blank!

In case this isn't clear, R eliminates X and L eliminates x.

There could be two wire crossings in the same row, in which case the order of these two swaps does not matter. You will never get something like |  X X  | (this does not make sense because it implies that the middle wire is being crossed over the wires on both its left and its right).

There aren't always crossings...

The input could be a single pipe. However, the input will never be blank.

Shortest valid solution wins on December 20th!

More Examples

As I promised:

Example 1

Input

| | | | | |
| |  X   x 
 X  |  x  |
|  x  |  X 
 X   X  | |
| | | | | |


Output

1 2 R
3 4 R
2 3 L
5 6 R
1 2 R
4 5 L
3 4 R
5 6 L


Example 2

Input

| | |
 X  |
|  x 
| | |
|  X 
|  x 
| | |


Output

2 3 L
1 2 R


Example 3

Input

|


Output is blank. Yes, you have to deal with this case.

Example 4

Input

| |
 X 
 x 
 X 
 x 
 X 
 x 
 X 
 x 
 X 
 x 
| |


Output is blank. Just for fun :).

Example 5

Input

| |
 X 
 X 
 x 
 X 
 x 
 x 
| |


Output is still blank...
Pyth - 26 25 bytes
Very straightforward, maybe I can golf the filtering.
fhhT_m+hB/xrdZ\x2@&quot;RL&quot;}\x

Try it online here.