#include <bits/stdc++.h>
using namespace std;
vector<string> s[100];
vector<string> ll;
int n;
int pmatch(string temp, string t) {
  for (int i = 0; i < t.length(); i++) {
    if (temp[i] != t[i]) {
      return 0;
    }
  }
  return 1;
}
int sufmatch(string temp, string t) {
  for (int i = 0; i < t.length(); i++) {
    if (temp[n - t.length() + i] != t[i]) {
      return 0;
    }
  }
  return 1;
}
int check(string temp) {
  queue<string> v[n];
  for (int l = 1; l < n; l++) {
    int x = 0;
    if (pmatch(temp, s[l][0]) && sufmatch(temp, s[l][1])) {
      x = 1;
      v[l].push("P");
      v[l].push("S");
    }
    if (x == 0 && pmatch(temp, s[l][1]) && sufmatch(temp, s[l][0])) {
      x = 1;
      v[l].push("S");
      v[l].push("P");
    }
    if (x == 0) {
      return 0;
    }
  }
  for (auto i : ll) {
    cout << v[i.length()].front();
    v[i.length()].pop();
  }
  return 1;
}
int main() {
  cin >> n;
  for (int i = 0; i < 2 * n - 2; i++) {
    string t;
    cin >> t;
    ll.push_back(t);
    s[t.length()].push_back(t);
  }
  if (n == 2) {
    cout << "PS";
    return 0;
  }
  string temp = s[1][0] + s[n - 1][0];
  if (check(temp) == 1) {
    return 0;
  }
  temp = s[1][0] + s[n - 1][1];
  if (check(temp) == 1) {
    return 0;
  }
  temp = s[1][1] + s[n - 1][0];
  if (check(temp) == 1) {
    return 0;
  }
  temp = s[1][1] + s[n - 1][1];
  if (check(temp) == 1) {
    return 0;
  }
}
