#include <bits/stdc++.h>
using namespace std;
long long const mod = 1e9 + 7;
long long const inf = 2e18;
inline long long add(long long a, long long b) {
  return (a % mod + b % mod + mod) % mod;
}
inline long long mul(long long a, long long b) {
  return (a % mod * b % mod + mod) % mod;
}
inline long long sub(long long a, long long b) {
  return (a % mod - b % mod + mod) % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long modexp(long long x, long long n) {
  if (n == 0) {
    return 1;
  } else if (n & 1) {
    return (modexp((x * x) % mod, n / 2) % mod * x % mod) % mod;
  } else {
    return (modexp((x * x) % mod, n / 2) % mod);
  }
}
long long modinv(long long n) { return modexp(n, mod - 2); }
long long n;
vector<string> a[201];
map<string, set<long long>> m;
bool pos(string x) {
  string pre = "", suf = "";
  for (long long i = 0; i < (n - 1); i++) {
    pre = pre + x[i];
    suf = x[n - 1 - i] + suf;
    if ((a[i][0] == pre && a[i][1] == suf) ||
        (a[i][0] == suf && a[i][1] == pre))
      continue;
    else
      return false;
  }
  return true;
}
void solve() {
  m.clear();
  cin >> n;
  string ans = "";
  for (long long i = 0; i < ((2 * n - 2)); i++) {
    string x;
    cin >> x;
    a[x.size() - 1].push_back(x);
    m[x].insert(i);
  }
  for (long long i = 0; i < (2 * n - 2); i++) ans.push_back('0');
  string s1 = a[n - 2][0] + a[n - 2][1][n - 2];
  string s2 = a[n - 2][1] + a[n - 2][0][n - 2];
  if (pos(s1)) {
    string p = "", second = "";
    for (int i = 0; i < n - 1; i++) {
      p = p + s1[i];
      long long id = *(m[p].begin());
      ans[id] = 'P';
      m[p].erase(id);
      second = s1[n - 1 - i] + second;
      id = *(m[second].begin());
      ans[id] = 'S';
      m[second].erase(id);
    }
  } else if (pos(s2)) {
    string p = "", second = "";
    for (int i = 0; i < n - 1; i++) {
      p = p + s2[i];
      long long id = *(m[p].begin());
      ans[id] = 'P';
      m[p].erase(id);
      second = s2[n - 1 - i] + second;
      id = *(m[second].begin());
      ans[id] = 'S';
      m[second].erase(id);
    }
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  for (int t = 1; t <= T; t++) {
    solve();
  }
  return 0;
}
