#include <bits/stdc++.h>
using namespace std;
pair<string, bool> lol(string a, string b, int n, string h[]) {
  int i, j, k;
  map<int, bool> x;
  map<string, bool> y;
  string s;
  a += b[(int)(b.size()) - 1];
  bool mv;
  pair<string, bool> jhand;
  jhand.first = "";
  jhand.second = true;
  for (i = 0; i < 2 * n - 2; ++i) {
    mv = true;
    s = h[i];
    for (j = 0; j < (int)(s.size()); ++j) {
      if (s[j] != a[j]) {
        mv = false;
        break;
      }
    }
    if (!mv) continue;
    if (!y[s]) {
      y[s] = true;
      x[i] = true;
    }
  }
  if ((int)(y.size()) != n - 1) {
    jhand.second = false;
    return jhand;
  }
  for (i = 0; i < 2 * n - 2; ++i) {
    s = h[i];
    mv = true;
    if (!x[i]) {
      for (j = 0; j < (int)(s.size()); j++) {
        if (s[(int)(s.size()) - j - 1] != a[(int)(a.size()) - j - 1]) {
          mv = false;
          break;
        }
      }
    }
    if (!mv) {
      jhand.second = false;
      return jhand;
    }
  }
  s.clear();
  for (i = 0; i < 2 * n - 2; ++i) {
    if (x[i])
      s += "P";
    else
      s += "S";
  }
  jhand.first = s;
  return jhand;
}
int main() {
  int n, i, j, m;
  cin >> n;
  m = 2 * n - 2;
  string a[m], s, d;
  for (i = 0; i < m; ++i) {
    cin >> a[i];
    if ((int)(a[i].size()) == n - 1) {
      if ((int)(s.size()) == 0)
        s = a[i];
      else
        d = a[i];
    }
  }
  pair<string, bool> k;
  k = lol(s, d, n, a);
  if (k.second)
    cout << k.first;
  else
    cout << lol(d, s, n, a).first;
}
