#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
long long sqr(long long n) { return n * n; }
long long binpow(long long a, long long n) {
  if (n == 0) return 1;
  if (n % 2 != 0)
    return binpow(a, n - 1) * a;
  else {
    long long b = binpow(a, n / 2);
    return b * b;
  }
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int n;
vector<string> v;
string ans;
bool check(string s1, string s2) {
  string s = s1 + s2.substr(n - 2);
  multiset<string> v1, pref, suff;
  for (int i = 0; i < n - 1; i++) {
    pref.insert(s.substr(0, n - i - 1));
    v1.insert(s.substr(0, n - i - 1));
    suff.insert(s.substr(i + 1));
    v1.insert(s.substr(i + 1));
  }
  if (v1 == multiset<string>(v.begin(), v.end())) {
    for (int i = 0; i < 2 * n - 2; i++) {
      if (pref.count(v[i])) {
        ans += 'P';
        pref.erase(v[i]);
      } else if (suff.count(v[i])) {
        ans += 'S';
        suff.erase(v[i]);
      } else {
        ans = "";
        return false;
      }
    }
    return true;
  }
  return false;
}
void solve() {
  cin >> n;
  v = vector<string>(2 * n - 2);
  string mx1 = "", mx2 = "";
  for (int i = 0; i < 2 * n - 2; i++) {
    cin >> v[i];
    if (v[i].size() == n - 1 && mx1.size() == 0)
      mx1 = v[i];
    else if (v[i].size() == n - 1 && mx2.size() == 0)
      mx2 = v[i];
  }
  if (check(mx1, mx2))
    cout << ans << endl;
  else {
    check(mx2, mx1);
    cout << ans << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
