#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> s;
string ans(200, ' ');
set<string> Set;
vector<string> cand;
int main() {
  cin >> n;
  ans.resize(2 * n - 2);
  for (int i = 0; i < 2 * n - 2; ++i) {
    string a;
    cin >> a;
    Set.insert(a);
    s.push_back(a);
    if (a.size() == n - 1) cand.push_back(a);
  }
  bool prefix = true, suffix = true;
  string P, S;
  for (int i = 1; i < n - 1; ++i) prefix &= Set.count(cand[0].substr(0, i));
  for (int i = 1; i < n - 1; ++i)
    suffix &= Set.count(cand[1].substr(n - 1 - i));
  if (suffix && prefix && cand[0].substr(1, n - 1) == cand[1].substr(0, n - 2))
    P = cand[0], S = cand[1];
  else
    P = cand[1], S = cand[0];
  for (int i = 1; i <= n - 1; ++i) {
    string sub = P.substr(0, i);
    for (int j = 0; j < ans.size(); ++j)
      if (ans[j] == ' ' && s[j] == sub) {
        ans[j] = 'P';
        break;
      }
  }
  for (int i = 0; i < ans.size(); ++i)
    if (ans[i] == ' ') ans[i] = 'S';
  cout << ans << endl;
  return 0;
}
