#include <bits/stdc++.h>
using namespace std;
int n, nums;
string t[1005], s[1005];
bool isprefix(string x, string u) {
  for (int i = 0; x[i]; i++)
    if (x[i] != u[i]) return 0;
  return 1;
}
bool issuffix(string x, string u) {
  reverse(x.begin(), x.end());
  reverse(u.begin(), u.end());
  for (int i = 0; x[i]; i++) {
    if (x[i] != u[i]) return 0;
  }
  return 1;
}
bool check_substrings(string fin) {
  for (int i = 0; i < nums; i += 2) {
    if (isprefix(t[i], fin) && issuffix(t[i + 1], fin)) {
    } else if (issuffix(t[i], fin) && isprefix(t[i + 1], fin)) {
    } else {
      return 0;
    }
  }
  return 1;
}
bool compare(string a, string b) {
  if (a.length() == b.length()) return a < b;
  return a.length() < b.length();
}
string make_string(string a, string b) {
  int n = a.length() + 1;
  string fin = a;
  fin += b[b.length() - 1];
  bool flag = check_substrings(fin);
  if (flag) return fin;
  fin = b;
  fin += a[a.length() - 1];
  return fin;
}
void solve() {
  cin >> n;
  nums = (2 * n - 2);
  for (int i = 0; i < nums; i++) {
    cin >> s[i];
    t[i] = s[i];
  }
  sort(t, t + nums, compare);
  string u = make_string(t[nums - 1], t[nums - 2]);
  int pref[2 * n];
  for (int i = 0; i < nums; i += 2) {
    if (t[i] == t[i + 1]) {
      int cnt = 0;
      for (int j = 0; j < nums; j++) {
        if (s[j] == t[i]) {
          pref[j] = cnt;
          cnt++;
        }
      }
    } else {
      if (isprefix(t[i], u)) {
        for (int j = 0; j < nums; j++)
          if (s[j] == t[i]) {
            pref[j] = 0;
          }
        for (int j = 0; j < nums; j++)
          if (s[j] == t[i + 1]) {
            pref[j] = 1;
          }
      } else {
        for (int j = 0; j < nums; j++)
          if (s[j] == t[i]) {
            pref[j] = 1;
          }
        for (int j = 0; j < nums; j++)
          if (s[j] == t[i + 1]) {
            pref[j] = 0;
          }
      }
    }
  }
  for (int i = 0; i < nums; i++)
    if (pref[i] == 0)
      cout << "P";
    else
      cout << "S";
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}
