#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[2 * n - 2];
  int m = 2 * n - 2;
  vector<string> s1;
  for (int i = 0; i < m; i++) {
    cin >> s[i];
    if (s[i].size() == n - 1) s1.push_back(s[i]);
  }
  map<string, int> s2;
  map<string, char> s3;
  string p;
  string p1;
  for (int i = 0; i < n - 1; i++) {
    p.push_back(s1[0][i]);
    s2[p]++;
    s3[p] = 'P';
  }
  for (int i = n - 2; i >= 0; i--) {
    p1.insert(p1.begin(), s1[1][i]);
    s2[p1]++;
    s3[p1] = 'S';
  }
  bool ok = true;
  for (int i = 0; i < m; i++) {
    if (s2.find(s[i]) == s2.end()) ok = false;
  }
  if (ok == true) {
    for (int i = 0; i < m; i++) {
      if (s2[s[i]] == 1)
        cout << s3[s[i]];
      else {
        cout << 'P';
        s2[s[i]]--;
        s3[s[i]] = 'S';
      }
    }
  } else {
    map<string, int> s2;
    map<string, char> s3;
    string p;
    string p1;
    for (int i = 0; i < n - 1; i++) {
      p.push_back(s1[1][i]);
      s2[p]++;
      s3[p] = 'P';
    }
    for (int i = n - 2; i >= 0; i--) {
      p1.insert(p1.begin(), s1[0][i]);
      s2[p1]++;
      s3[p1] = 'S';
    }
    for (int i = 0; i < m; i++) {
      if (s2[s[i]] == 1)
        cout << s3[s[i]];
      else {
        cout << 'P';
        s2[s[i]]--;
        s3[s[i]] = 'S';
      }
    }
  }
}
