#include <bits/stdc++.h>

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n, k, m;
  std::cin >> n >> k >> m;
  auto r = m * n;
  std::vector<int64_t> a(n - 1);
  std::cin >> a;
  r -= summation(a.cbegin(), a.cend());

  if (k < r) {
    std::cout << -1 << std::endl;
  } else {
    std::cout << std::max(static_cast<int64_t>(0), r) << std::endl;
  }
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

const long long MOD = 1e9 + 7;
const int INF = 1e9;
const long long inf = 1LL<<60;

//cout << fixed << setprecision(10) <<  << endl;
char judge(char a, char b) {
  if (a == b) return a;
  if (a == 'P') {
    if (b == 'R') {
      return a;
    } else {
      return b;
    }
  } else if (a == 'R') {
    if (b == 'S') {
      return a;
    } else {
      return b;
    }
  } else {
    if (b == 'P') {
      return a;
    } else {
      return b;
    }
  }
}

int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  auto run = [&]() -> void {
    string t = s + s;
    s = "";
    for (int i=0; i<n*2; i+=2) {
      s += judge(t.at(i), t.at(i+1));
    }
  };
  for (int i=0; i<k; i++) {
    run();
  }
  cout << s.at(0) << endl;
}
