#include <bits/stdc++.h>
using namespace std;
bool cmp(string a, string b) { return a.size() > b.size(); }
int n;
vector<string> v;
string s[250];
map<string, int> m;
map<string, bool> bio;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < 2 * n - 2; i++) {
    cin >> s[i];
    v.push_back(s[i]);
  }
  sort(v.begin(), v.end(), cmp);
  string suffix = v[0];
  string prefix = v[1];
  for (int i = 2; i < 2 * n - 2; i += 2) {
    if (suffix.substr(i / 2, n - 1 - i / 2) == v[i]) {
      if (prefix.substr(0, n - 1 - i / 2) == v[i + 1]) {
        goto kraj1;
      }
    }
    if (suffix.substr(i / 2, n - 1 - i / 2) == v[i + 1]) {
      if (prefix.substr(0, n - 1 - i / 2) == v[i]) {
        goto kraj1;
      }
    }
    goto izlaz;
  kraj1:;
  }
  if (v[0] != v[1]) {
    m[v[0]] = 2;
    m[v[1]] = 1;
  } else
    m[v[0]] = 3;
  for (int i = 2; i < 2 * n - 2; i += 2) {
    if (suffix.substr(i / 2, n - 1 - i / 2) == v[i]) {
      if (prefix.substr(0, n - 1 - i / 2) == v[i + 1]) {
        if (v[i] != v[i + 1]) {
          m[v[i]] = 2;
          m[v[i + 1]] = 1;
        } else {
          m[v[i]] = 3;
        }
        goto kraj2;
      }
    }
    if (suffix.substr(i / 2, n - 1 - i / 2) == v[i + 1]) {
      if (prefix.substr(0, n - 1 - i / 2) == v[i]) {
        if (v[i] != v[i + 1]) {
          m[v[i]] = 1;
          m[v[i + 1]] = 2;
        } else {
          m[v[i]] = 3;
        }
        goto kraj2;
      }
    }
  kraj2:;
  }
  for (int i = 0; i < 2 * n - 2; i++) {
    if (m[s[i]] == 1)
      cout << 'P';
    else if (m[s[i]] == 2)
      cout << 'S';
    else {
      if (!bio[s[i]]) {
        bio[s[i]] = 1;
        cout << 'P';
      } else
        cout << 'S';
    }
  }
  return 0;
izlaz:;
  suffix = v[1];
  prefix = v[0];
  if (v[0] != v[1]) {
    m[v[0]] = 1;
    m[v[1]] = 2;
  } else
    m[v[0]] = 3;
  for (int i = 2; i < 2 * n - 2; i += 2) {
    if (suffix.substr(i / 2, n - 1 - i / 2) == v[i]) {
      if (prefix.substr(0, n - 1 - i / 2) == v[i + 1]) {
        if (v[i] != v[i + 1]) {
          m[v[i]] = 2;
          m[v[i + 1]] = 1;
        } else {
          m[v[i]] = 3;
        }
        goto kraj3;
      }
    }
    if (suffix.substr(i / 2, n - 1 - i / 2) == v[i + 1]) {
      if (prefix.substr(0, n - 1 - i / 2) == v[i]) {
        if (v[i] != v[i + 1]) {
          m[v[i]] = 1;
          m[v[i + 1]] = 2;
        } else {
          m[v[i]] = 3;
        }
        goto kraj3;
      }
    }
  kraj3:;
  }
  for (int i = 0; i < 2 * n - 2; i++) {
    if (m[s[i]] == 1)
      cout << 'P';
    else if (m[s[i]] == 2)
      cout << 'S';
    else {
      if (!bio[s[i]]) {
        bio[s[i]] = 1;
        cout << 'P';
      } else
        cout << 'S';
    }
  }
  return 0;
}
