#include <bits/stdc++.h>
using namespace std;
int n, ans[1100], out[1100];
struct node {
  string str;
  long long len;
  int id;
} nodes[1100 << 1];
bool cmp(node a, node b) { return a.len < b.len; }
void dfs(int now, string f, string b) {
  if (now >= n) {
    for (int i = 1; i <= n * 2 - 2; i++) {
      if (ans[i] == 1) {
        out[nodes[i].id] = 1;
      } else if (ans[i] == 2) {
        out[nodes[i].id] = 2;
      }
    }
    for (int i = 1; i <= n * 2 - 2; i++) {
      if (out[i] == 1) {
        printf("P");
      } else if (out[i] == 2) {
        printf("S");
      }
    }
    exit(0);
  }
  if (nodes[now * 2 - 1].str.substr(0, f.size()) == f &&
      nodes[now * 2].str.substr(1) == b) {
    ans[now * 2 - 1] = 1;
    ans[now * 2] = 2;
    dfs(now + 1, nodes[now * 2 - 1].str, nodes[now * 2].str);
    ans[now * 2 - 1] = 0;
    ans[now * 2] = 0;
  }
  if (nodes[now * 2].str.substr(0, f.size()) == f &&
      nodes[now * 2 - 1].str.substr(1) == b) {
    ans[now * 2 - 1] = 2;
    ans[now * 2] = 1;
    dfs(now + 1, nodes[now * 2].str, nodes[now * 2 - 1].str);
    ans[now * 2 - 1] = 0;
    ans[now * 2] = 0;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n - 2; i++) {
    cin >> nodes[i].str;
    nodes[i].len = nodes[i].str.length();
    nodes[i].id = i;
  }
  sort(nodes + 1, nodes + 2 * n - 1, cmp);
  if (nodes[1].str == nodes[2].str) {
    ans[1] = 1;
    ans[2] = 2;
    dfs(2, nodes[1].str, nodes[1].str);
  } else {
    ans[1] = 1;
    ans[2] = 2;
    dfs(2, nodes[1].str, nodes[2].str);
    ans[1] = 2;
    ans[2] = 1;
    dfs(2, nodes[2].str, nodes[1].str);
  }
  return 0;
}
