#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int main() {
  int n;
  scanf("%d", &n);
  ;
  vector<string> v;
  string s1, s2, s3, s4;
  int p = 1, q = 1;
  for (int i = 0; i < 2 * n - 2; i++) {
    string s;
    cin >> s;
    v.push_back(s);
    if (s.length() == n - 1) {
      if (p) {
        s1 = s;
        p = 0;
      } else {
        s2 = s;
      }
    }
    if (s.length() == n - 2) {
      if (q) {
        s3 = s;
        q = 0;
      } else {
        s4 = s;
      }
    }
  }
  int z = n - 1;
  bool hell = 1;
  for (int i = 1; i < z; i++) {
    if (s1[i] != s2[i - 1]) {
      hell = 0;
      break;
    }
  }
  string ans;
  if (hell) {
    s1 = s1 + s2[n - 2];
    ans = s1;
  }
  bool hell1 = 1;
  for (int i = 1; i < z; i++) {
    if (s2[i] != s1[i - 1]) {
      hell1 = 0;
      break;
    }
  }
  string ans1;
  if (hell1) {
    s2 = s2 + s1[n - 2];
    ans1 = s2;
  }
  string uts, uts1;
  int check[n + 1];
  memset(check, -1, sizeof(check));
  string ans9;
  if (hell == 1 && hell1 == 0)
    ans9 = ans;
  else if (hell1 == 1 && hell == 0)
    ans9 = ans1;
  else {
    string ma1 = ans.substr(0, n - 2);
    string ma2 = ans.substr(2, n - 2);
    if ((ma1 == s3 && ma2 == s4) || (ma1 == s4 && ma2 == s3))
      ans9 = ans;
    else
      ans9 = ans1;
  }
  for (auto it : v) {
    string s = it;
    int l = s.length();
    bool k = 1;
    if (check[l] == -1)
      for (int i = 0; i < l; i++) {
        if (s[i] != ans9[i]) {
          k = 0;
        }
      }
    else {
      if (check[l]) {
        uts += "P";
      } else {
        uts += "S";
      }
      continue;
    }
    if (k) {
      uts += "P";
      check[l] = 0;
    } else {
      uts += "S";
      check[l] = 1;
    }
  }
  cout << uts;
}
