#include <bits/stdc++.h>
char _;
using namespace std;
void PRINT(int x, int y) {
  for (int i = y - 1; i >= 0; i--) {
    cout << ((0u == (x & (1 << i))) ? 0u : 1u);
  }
  cout << endl;
}
int n;
vector<pair<pair<int, string>, int> > s;
bool check(string suf, string pre) {
  bool used[300] = {0}, len[301] = {0};
  len[suf.length()] = true;
  if (s.back().first.second == pre) {
    used[2 * n - 2 - 1] = true;
  } else {
    used[2 * n - 2 - 2] = true;
  }
  for (int x = 0; x < ((2 * n - 2 - 2)); x++) {
    for (int i = 0; i < ((int)s[x].first.second.length()); i++) {
      if (pre[i] != s[x].first.second[i]) {
        break;
      } else if (i == (int)s[x].first.second.length() - 1 &&
                 !len[s[x].first.second.length()]) {
        used[x] = true;
        len[s[x].first.second.length()] = true;
      }
    }
  }
  for (int x = 0; x < (n - 1); x++) {
    if (!len[x + 1]) {
      return false;
    }
  }
  for (int x = 0; x < (2 * n - 2 - 2); x++) {
    if (!used[x]) {
      for (int i = 0; i < (int)s[x].first.second.length(); i++) {
        if (s[x].first.second[i] !=
            suf[(int)suf.length() - 1 - (int)s[x].first.second.length() + 1 +
                i]) {
          return false;
        }
      }
    }
  }
  bool ans[300] = {0};
  for (int x = 0; x < (2 * n - 2); x++) {
    if (used[x]) {
      ans[s[x].second] = true;
    }
  }
  for (int x = 0; x < (2 * n - 2); x++) {
    if (ans[x] == true) {
      cout << "P";
    } else {
      cout << "S";
    }
  }
  cout << "\n";
  return true;
}
int main() {
  cin >> n;
  for (int x = 0; x < (2 * n - 2); x++) {
    string S;
    cin >> S;
    s.push_back(make_pair(make_pair(S.length(), S), x));
  }
  sort((s).begin(), (s).end());
  string pre, suf;
  pre = s[2 * n - 2 - 1].first.second;
  suf = s[2 * n - 2 - 1 - 1].first.second;
  if (!check(suf, pre)) {
    if (!check(pre, suf)) {
      cout << -1 << "\n";
    }
  }
}
