#include <bits/stdc++.h>
using namespace std;
vector<string> v;
string ans;
bool check(string s) {
  ans = "";
  int n = s.size();
  map<string, int> pref, suff;
  for (int i = 0; i < n; i++) {
    pref[s.substr(0, i + 1)]++;
    suff[s.substr(n - i - 1, n)]++;
  }
  int flag = 1;
  for (int i = 0; i < (int)v.size(); i++) {
    if (pref[v[i]] > 0) {
      ans += 'P';
      pref[v[i]]--;
    } else if (suff[v[i]] > 0) {
      ans += 'S';
      suff[v[i]]--;
    } else {
      flag = 0;
      break;
    }
  }
  return flag;
}
int main() {
  int n;
  cin >> n;
  vector<string> orig;
  for (int i = 0; i < 2 * n - 2; i++) {
    string s;
    cin >> s;
    v.push_back(s);
    if (s.size() == n - 1) orig.push_back(s);
  }
  if (check(orig[0] + orig[1][n - 2]))
    cout << ans << endl;
  else {
    check(orig[1] + orig[0][n - 2]);
    cout << ans << endl;
  }
}
