Pawns
In the first grade, Gleb developed a keen interest in chess. At that time, he only understood how the pawn moves: it can capture diagonally to the left-up and right-up, and move one square up if that square is unoccupied. Gleb was unaware of the pawn's ability to be promoted to a queen, so he created his own version of chess.
This game is played on a board with N rows and M columns (1 ≤ N ≤ 100, 1 ≤ M ≤ 100) following these rules: The bottom row, numbered 1, contains P white pawns, and no other white pieces are present on the board. Various black pieces (whose names Gleb does not know) are scattered across the rest of the board. Only the white pawns can move, and their objective is to capture all the black pieces.
As in traditional chess, when a pawn captures a black piece, it occupies the square of the captured piece, which is then removed from the board. Gleb wins if he captures all the black pieces with the white pawns; otherwise, he loses. Your task is to determine whether Gleb can win given the initial setup of the pieces, and if so, provide the correct sequence of moves for the white pawns.
Input
The input begins with four integers: N, M, P, K (1 ≤ N ≤ 100, 1 ≤ M ≤ 100, 0 ≤ P ≤ M, 1 ≤ K ≤ 1000, K ≤ (M-1)·N). Following this, P distinct integers are provided, representing the column numbers p_j (1 ≤ p_j ≤ M) where the white pawns are positioned. Then, K distinct pairs of integers are given, indicating the coordinates (row and column) of the black pieces r_i, c_i (2 ≤ r_i ≤ N, 1 ≤ c_i ≤ M).
Output
If the pawns cannot capture all the black pieces, output the single word NO.
If they can, output YES on the first line. The second line should contain the total number of moves C, followed by C lines detailing the moves of the pawns, one move per line. Each move is specified by the coordinates r, c of the pawn (row and column numbers) that will move, and a symbol m, which can be: L for capturing forward and left, R for capturing forward and right, or F for moving forward. Each move should be output with a single space separating the coordinates and the type of move.
If there are multiple valid sequences of moves, you may output any one of them. Note that minimizing the number of moves is not necessary.