/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming
Contest 1

Solution to Glitch Bot: https://open.kattis.com/problems/glitchbot
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
    int x, y, n;
    cin >> x >> y >> n;
    vector<string> dir(n);
    for(int i = 0; i < n; i++) {
        cin >> dir[i];
    }

    //A list of options for each instruction
    vector<string> op = {"Forward", "Left", "Right"};

    //Try changing each instruction to one of the other directions
    for(int i = 0; i < n; i++) {
        string prev = dir[i];
        //Update this instruction to a different direction
        for(int k = 0; k < 3; k++) {
            dir[i] = op[k];  

            //Determine if this update fixes the robot
            int curx = 0, cury = 0, d = 0;
            for(int j = 0; j < n; j++) {
                //Move the robot according to each instruction
                if(dir[j] == "Forward") {
                    //For d: 0 = north, 1 = west, 2 = south, 3 = east
                    if(d == 0) cury++;
                    else if(d == 1) curx--;
                    else if(d == 2) cury--;
                    else curx++;
                } else if(dir[j] == "Right") {
                    //Turn right and adjust d
                    d--;
                    if(d < 0) d += 4;
                } else {
                    //Turn left and adjust d
                    d++;
                    if(d >= 4) d -= 4;
                }
            }

            //If the robot reaches the correct position, output this fix
            if(curx == x && cury == y) {
                cout << i+1 << ' ' << op[k] << endl;
                return 0;
            }

            //Make sure to reset the instruction afterwards so that only one is changed each time
            dir[i] = prev;
        }
    }
}