#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
template <class T>
inline T gethash(T h[], T power[], int l, int r) {
  if (r < l) return (T)0;
  return h[l] - h[r + 1] * power[r - l + 1];
}
struct data {
  data() {}
  bool friend operator<(data a, data b) { return 0; }
};
int n, m, k;
long long N, M, K;
string s[305];
int ans[305];
vector<string> vs;
unsigned long long H[305];
unsigned long long mhash(string s) {
  unsigned long long h = 0;
  for (int i = 0; i < s.length(); i++) {
    h = h * (unsigned long long)101949101 + s[i];
  }
  return h;
}
int main() {
  int t, tc = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n * 2 - 2; i++) {
    cin >> s[i];
    int l = s[i].length();
    H[i] = mhash(s[i]);
    if (l == n - 1) {
      vs.push_back(s[i]);
    }
  }
  for (int i = 0; i < 2; i++) {
    memset(ans, 0, sizeof ans);
    string x = vs[i];
    string y = vs[1 - i];
    reverse(y.begin(), y.end());
    string p = "";
    int ct = 0;
    unsigned long long h = 0;
    for (int j = 0; j < n - 1; j++) {
      h = h * (unsigned long long)101949101 + x[j];
      for (int k = 1; k <= 2 * n - 2; k++) {
        if (h == H[k]) {
          ans[k] = 1;
          ct++;
          break;
        }
      }
    }
    if (ct == n - 1) {
      h = 0;
      int ct2 = 0;
      unsigned long long po = 1;
      for (int j = 0; j < n - 1; j++) {
        h = y[j] * po + h;
        po *= (unsigned long long)101949101;
        for (int k = 1; k <= 2 * n - 2; k++) {
          if (ans[k] == 0 && h == H[k]) {
            ct2++;
            break;
          }
        }
      }
      if (ct2 == n - 1) {
        for (int z = 1; z <= 2 * n - 2; z++) {
          if (ans[z] == 1) {
            cout << 'P';
          } else {
            cout << 'S';
          }
        }
        return 0;
      }
    }
  }
  cout << 1 / 0;
  return 0;
}
