#include <bits/stdc++.h>
using namespace std;
string s1, s2, s[200], a;
bool vis[200];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n - 2; i++) {
    cin >> s[i];
    if (s[i].size() == n - 1) {
      if (s1.size() == 0)
        s1 = s[i];
      else
        s2 = s[i];
    }
  }
  bool flag = 0;
  a = s1 + s2[s2.size() - 1];
  for (int i = 1; i <= 2 * n - 2; i++) {
    string te = a.substr(0, s[i].size());
    string tw = a.substr(a.size() - s[i].size(), a.size());
    if (te == s[i] || tw == s[i])
      continue;
    else {
      flag = 1;
      break;
    }
  }
  if (flag) a = s2 + s1[s1.size() - 1];
  for (int i = 1; i <= 2 * n - 2; i++) {
    string te = a.substr(0, s[i].size());
    if (te == s[i] && !vis[s[i].size()])
      printf("P"), vis[s[i].size()] = 1;
    else
      printf("S");
  }
  puts("");
}
