#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
using namespace std;

const char* actions = "KPR";
int get_random() {
    ifstream in("/dev/urandom", ios::binary);
    int num;
    in.read((char*)&num, sizeof(num));
    return num;
}
void init_randomness() { srand(get_random()); }
char random_action() { return actions[rand() % 3]; }
char my_turn, their_turn;

#define BRAIN_SIZE 2
char stats_buffer[BRAIN_SIZE];

int main() {
    init_randomness();
    their_turn = random_action();
    for (int i = 0; i < BRAIN_SIZE; i++) stats_buffer[i] = their_turn;
    int cur = 0;

    do {
        stats_buffer[cur] = their_turn;
        cur = (cur + 1) % BRAIN_SIZE;

        // If the two last turns repeat, we try to beat them,
        // otherwise play random
        if (stats_buffer[0] == stats_buffer[1]) {
           switch(stats_buffer[0]) {
                   case 'K':
                           my_turn = 'P';
                           break;
                   case 'P':
                           my_turn = 'R';
                           break;
                   case 'R':
                           my_turn = 'K';
                           break;
          }
        }
        else {
          my_turn = random_action();
        }
        cout << my_turn << endl;
        cin >> their_turn;
    }
    while (their_turn != 'L');

    return 0;
}


