#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <numeric>
#include <string>
#include <cstring>
#include <cmath>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long int int64;


const int N = 105;
char s[N];
char dp[N][N];

int getWin(char a, char b)
{
    if (a == b)
        return a;
    if (a == 'R')
    {
        if (b == 'S')
            return a;
        return b;
    }
    if (a == 'P')
    {
        if (b == 'R')
            return a;
        return b;
    }
    if (a == 'S')
    {
        if (b == 'P')
            return a;
        return b;
    }
}

int main(int,  char **)
{
#ifdef LOCAL
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

    int n, k;
    scanf("%d%d", &n, &k);
    scanf("%s", s);

    for (int sh = 0; sh < n; sh++)
        dp[0][sh] = s[sh];

    int deg = 1;
    for (int i = 0; i < k; i++)
    {
        for (int sh = 0; sh < n; sh++)
        {
            dp[i + 1][sh] = getWin(dp[i][sh], dp[i][(sh + deg) % n]);
        }
        deg = (deg * 2) % n;
    }
    printf("%c\n", dp[k][0]);

	return 0;
}



//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
//#include<ctime>
//#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vc = vector<char>;
using vvc = vector<vc>;

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b , a % b);
}

const ll MOD = 1000000007;
const ll MAX = 2000001;

ll mod(ll a){
  return a % MOD;
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}

//ここに適切な判断条件を書く
bool isOK(ll index,ll n) {
  if(((long double)(index+1) <= 2.0*(long double)(n+1)/(long double)(index))
   and (index*(index+1))/2 <= n+1) return true;
  return false;
}

//臨機応変に引数を書き換える
int binary_search(ll n) {
    ll ok = 0;
    ll ng = min(n,ll(1000000002));


    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;

        if (isOK(mid,n)) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main(){
  ll n,k; string s; cin >> n >> k >> s;

  if(n % 2 == 1) s += s;

  ll now = n;

  //cout << s << endl;

  ll cnt = 0;

  queue<char> q;

  for(char c : s){
    q.push(c);
  }

  while(cnt < k){
    if(q.size() % 2 == 1){
      queue<char> pq;
      rep(i,q.size()){

        pq.push(q.front());
        q.push(q.front());
        q.pop();
      }
      while(!pq.empty()){
        q.push(pq.front());
        pq.pop();
      }   
    }


    //cout << q.size() << endl;

    queue<char> pq;

    /*rep(i,q.size()){
      pq.push(q.front());
      q.pop();
    }
    while(!pq.empty()){
      cout << pq.front();
      q.push(pq.front());
      pq.pop();
    }
    cout << endl;*/

    
    now = q.size();

    rep(i,now/2){
      char first = q.front(); q.pop(); char second = q.front(); q.pop();

      if((first == 'P' and second == 'S') or (first == 'S' and second == 'P')){
        q.push('S');
      }
      else if((first == 'R' and second == 'S') or (first == 'S' and second == 'R')){
        q.push('R');
      }
      else if(first == second) q.push(first);
      else q.push('P');
    }

    cnt++;
  }

  cout << q.front() << endl;


}