#include <bits/stdc++.h>
using namespace std;
long long gcd(long long b, long long y) { return b > 0 ? gcd(y % b, b) : y; }
long long lcm(long long b, long long y) { return b * y / gcd(b, y); }
double dis(double x1, double x2, double y1, double y2) {
  double ans = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  return sqrt(ans);
}
double random(double start, double en) {
  return start + (en - start) * rand() / (RAND_MAX + 1.0);
}
void read(int &n) {
  char c = '+';
  int x = 0;
  bool flag = 0;
  while (c < '0' || c > '9') {
    c = getchar();
    if (c == '-') flag = 1;
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
  n = flag == 1 ? -x : x;
}
int main() {
  int n;
  while (cin >> n) {
    string s[210], q = "", h = "", e;
    int num[210];
    string ans;
    memset(num, 0, sizeof(num));
    for (int i = 0; i < 2 * n - 2; i++) {
      cin >> s[i];
      if (s[i].size() > q.size()) {
        q = s[i];
      } else if (s[i].size() == q.size()) {
        h = s[i];
      }
    }
    int flag = 0;
    e = q + h[n - 2];
    for (int i = 0; i < 2 * n - 2; i++) {
      if (e.substr(0, s[i].size()) == s[i] && !num[s[i].size()]) {
        ans += "P";
        num[s[i].size()] = 1;
      } else if (e.substr(n - s[i].size()) == s[i]) {
        ans += "S";
      } else {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << ans << endl;
    } else {
      e = h + q[n - 2];
      ans = "";
      memset(num, 0, sizeof(num));
      for (int i = 0; i < 2 * n - 2; i++) {
        if (e.substr(0, s[i].size()) == s[i] && !num[s[i].size()]) {
          ans += "P";
          num[s[i].size()] = 1;
        } else {
          ans += "S";
        }
      }
      cout << ans << endl;
    }
  }
}
