#include <bits/stdc++.h>
using namespace std;
bool sbst(string b, string pre, string suf) {
  int e = b.size();
  if (pre.substr(0, e).compare(b) == 0) {
    return true;
  } else
    return false;
}
int main() {
  map<string, char> mp;
  int n;
  cin >> n;
  string a, b;
  string ar[2 * n - 2];
  int d = 0;
  for (int i = 0; i < 2 * n - 2; i++) {
    string t;
    cin >> t;
    ar[i] = t;
    if (t.size() == n - 1) {
      if (d == 0) {
        a = t;
        d++;
      } else
        b = t;
    }
  }
  if (a.size() == 1)
    cout << "PS";
  else {
    if (a.substr(1, n - 2).compare(b.substr(0, n - 2)) == 0) {
      for (int i = 0; i < 2 * n - 2; i++) {
        if (a.substr(0, ar[i].size()).compare(ar[i]) != 0 &&
            b.substr(n - 1 - ar[i].size(), ar[i].size()).compare(ar[i]) != 0) {
          string t = a;
          a = b;
          b = t;
        }
      }
      for (int i = 0; i < 2 * n - 2; i++) {
        if (mp.count(ar[i]) != 0) {
          if (mp[ar[i]] == 'S')
            cout << "P";
          else
            cout << "S";
          continue;
        }
        if (sbst(ar[i], a, b)) {
          cout << "P";
          mp[ar[i]] = 'P';
        } else {
          cout << "S";
          mp[ar[i]] = 'S';
        }
      }
    } else {
      for (int i = 0; i < 2 * n - 2; i++) {
        if (mp.count(ar[i]) != 0) {
          if (mp[ar[i]] == 'S')
            cout << "P";
          else
            cout << "S";
          continue;
        }
        if (sbst(ar[i], b, a)) {
          cout << "P";
          mp[ar[i]] = 'P';
        } else {
          cout << "S";
          mp[ar[i]] = 'S';
        }
      }
    }
  }
  return 0;
}
