#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
const int mod = 1e9 + 7;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int n;
char ans[210];
vector<pair<string, int> > v[110];
void check(string str) {
  bool used[110][2] = {};
  for (int i = 1; i < n; i++) {
    string s = v[i][0].first;
    bool chk = true;
    for (int j = 0; j < i; j++)
      if (s[j] != str[j]) chk = false;
    if (chk)
      used[i][0] = true;
    else {
      s = v[i][1].first;
      chk = true;
      for (int j = 0; j < i; j++)
        if (s[j] != str[j]) chk = false;
      if (chk)
        used[i][1] = true;
      else
        return;
    }
  }
  for (int i = n - 1; i > 0; i--) {
    for (int j = 0; j < 2; j++)
      if (!used[n - i][j]) {
        string s = v[n - i][j].first;
        bool chk = true;
        for (int k = (int)s.size() - 1, o = n - 1; k >= 0; k--, o--)
          if (str[o] != s[k]) chk = false;
        if (!chk) return;
      }
  }
  for (int i = 1; i < n; i++)
    for (int j = 0; j < 2; j++) {
      if (used[i][j])
        ans[v[i][j].second] = 'P';
      else
        ans[v[i][j].second] = 'S';
    }
  for (int i = 0; i < 2 * n - 2; i++) cout << ans[i];
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  for (int i = 0; i < 2 * n - 2; i++) {
    string s;
    cin >> s;
    v[(int)s.size()].push_back({s, i});
  }
  pair<string, int> s = v[n - 1][0], t = v[n - 1][1];
  check(s.first + t.first.back());
  check(t.first + s.first.back());
  return 0;
}
