#include <bits/stdc++.h>
using namespace std;
const int N = 500;
int n, res[N];
vector<pair<string, int> > a[N];
int main() {
  cin >> n;
  string s;
  for (int i = 1; i <= n * 2 - 2; i++) {
    cin >> s;
    a[s.size()].push_back(pair<string, int>(s, i));
  }
  res[a[n - 1][0].second] = 1;
  string Suffix = a[n - 1][0].first;
  string Prefix = a[n - 1][1].first;
  bool kt;
  string S;
  for (int i = n - 2; i; i--) {
    S = a[i][0].first;
    kt = true;
    for (int j = 0; j < S.size(); j++)
      if (S[j] != Suffix[j]) kt = false;
    if (kt) {
      res[a[i][0].second] = 1;
      continue;
    }
    res[a[i][1].second] = 1;
  }
  kt = true;
  for (int i = n - 2; i; i--) {
    if (res[a[i][0].second] == 0)
      S = a[i][0].first;
    else
      S = a[i][1].first;
    int nn = S.size();
    for (int j = 1; j <= nn; j++) {
      if (S[nn - j] != Prefix[Prefix.size() - j]) kt = false;
    }
  }
  if (kt) {
    for (int i = 1; i <= n * 2 - 2; i++) {
      if (res[i] == 1)
        cout << "P";
      else
        cout << "S";
    }
    return 0;
  }
  memset(res, 0, sizeof res);
  res[a[n - 1][1].second] = 1;
  Suffix = a[n - 1][1].first;
  for (int i = n - 2; i; i--) {
    S = a[i][0].first;
    kt = true;
    for (int j = 0; j < S.size(); j++)
      if (S[j] != Suffix[j]) kt = false;
    if (kt) {
      res[a[i][0].second] = 1;
      continue;
    }
    res[a[i][1].second] = 1;
  }
  for (int i = 1; i <= n * 2 - 2; i++) {
    if (res[i] == 1)
      cout << "P";
    else
      cout << "S";
  }
}
