#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

using namespace std;
typedef long long ll;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
const ll inf = ll(1e18) + 1;
const ll mod = 1000000007;

int main() {
	char win[222][222];
	win['R']['R'] = win['R']['S'] = win['S']['R'] = 'R';
	win['S']['S'] = win['S']['P'] = win['P']['S'] = 'S';
	win['P']['P'] = win['P']['R'] = win['R']['P'] = 'P';

	ll n,k;
	string s;
	cin >>n >> k >>s;

	while(k--){
		string t = s+s;

		rep(i,n){
			s[i] = win[t[i*2]][t[i*2+1]];
		}

	}

	cout << s[0] << endl;
	return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std; using ll = long long;
using ull = unsigned long long; using P = pair<int, int>;
const int INF = 1e9; const int MOD = 1000000007;
const int dx[] = {-1,0,1,0}; const int dy[] = {0,-1,0,1};
//const int dx[] = {-1,-1,-1, 0, 0, 1, 1, 1}; const int dy[] = {-1, 0, 1,-1, 1,-1, 0, 1};
#define PI 3.14159265358979323846264338327950L
// static const double e = 2.718281828459045;
//cout << fixed << setprecision(10) << ans << endl;

int main() {
    int n, k; cin >> n >> k;
    char s[200], t[200]; memset(s, 0x00, sizeof(s)); memset(t, 0x00, sizeof(t));
    cin >> s;
    for (int i = 0; i < k; i++) {
        for (int j = 0; j < n; j++) {
            char i1 = s[(2*j)%n];
            char i2 = s[(2*j+1)%n];
            if ( (i1 == 'R' && i2 == 'S') || (i1 == 'S' && i2 == 'R') ) {
                t[j] = 'R';
            } else if ((i1 == 'P' && i2 == 'R') || (i1 == 'R' && i2 == 'P')) {
                t[j] = 'P';
            } else if ((i1 == 'S' && i2 == 'P') || (i1 == 'P' && i2 == 'S')) {
                t[j] = 'S';
            } else if ((i1 == 'P' && i2 == 'P')) {
                t[j] = 'P';
            } else if ((i1 == 'R' && i2 == 'R')) {
                t[j] = 'R';
            } else if ((i1 == 'S' && i2 == 'S')) {
                t[j] = 'S';
            }
        }
        memcpy(s, t, 200);
    }
    cout << s[0] << endl;
}