#include <bits/stdc++.h>
using namespace std;
void fileio() {}
vector<vector<long long int>> g;
bool prefix(string s1, string s2) {
  long long int i = 0, j = 0;
  while (i < s1.size() and j < s2.size()) {
    if (s1[i] != s2[j]) return 0;
    i++;
    j++;
  }
  return 1;
}
bool suffix(string s1, string s2) {
  long long int i = s1.size() - 1, j = s2.size() - 1;
  while (i >= 0 and j >= 0) {
    if (s1[i] != s2[j]) return 0;
    i--;
    j--;
  }
  return 1;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fileio();
  long long int n;
  cin >> n;
  map<long long int, vector<long long int>> data;
  vector<string> a(2 * n - 2);
  for (long long int i = 0; i < 2 * n - 2; i++) {
    cin >> a[i];
    long long int l = a[i].size();
    data[l].push_back(i);
  }
  vector<char> res(2 * n - 2);
  long long int i = data[n - 1][0], j = data[n - 1][1], k = data[1][0],
                l = data[1][1];
  if (a[k] + a[i] != a[j] + a[l]) {
    if (a[l] + a[i] == a[j] + a[k]) {
      swap(l, k);
    } else {
      swap(i, j);
      if (a[k] + a[i] != a[j] + a[l]) {
        swap(l, k);
      }
    }
  }
  res[i] = 'P';
  res[k] = 'P';
  res[j] = 'S';
  res[l] = 'S';
  string c = a[k] + a[i];
  bool flag = 1;
  for (long long int x = 1; x <= n - 1; x++) {
    long long int y = data[x][0];
    long long int z = data[x][1];
    if ((prefix(c, a[y]) and suffix(c, a[z])) or
        (prefix(c, a[z]) and suffix(c, a[y]))) {
    } else {
      flag = 0;
    }
  }
  if (!flag) swap(i, j);
  if (a[k] + a[i] != a[j] + a[l]) {
    if (a[l] + a[i] == a[j] + a[k]) {
      swap(l, k);
    } else {
      swap(i, j);
      if (a[k] + a[i] != a[j] + a[l]) {
        swap(l, k);
      }
    }
  }
  c = a[k] + a[i];
  for (long long int x = 1; x <= n - 1; x++) {
    i = data[x][0], j = data[x][1];
    if (prefix(c, a[i]) and suffix(c, a[j])) {
      res[i] = 'P';
      res[j] = 'S';
    } else {
      res[i] = 'S';
      res[j] = 'P';
    }
  }
  for (auto it : res) cout << it;
  cout << '\n';
  return 0;
}
