#include <bits/stdc++.h>
using namespace std;
long long int min(long long int a, long long int b) { return a < b ? a : b; }
long long int min(long long int a, long long int b, long long int c) {
  a = min(a, b);
  a = min(a, c);
  return a;
}
long long int max(long long int a, long long int b) { return a > b ? a : b; }
long long int max(long long int a, long long int b, long long int c) {
  a = max(a, b);
  a = max(a, c);
  return a;
}
long long int dsum(long long int n) {
  long long int ans = 0;
  while (n) {
    ans += (n % 10);
    n /= 10;
  }
  return ans;
}
long long int power(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long int Ceil(long long int a, long long int b) {
  long long int res = a / b;
  if (a % b != 0) res++;
  return res;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &t : v) is >> t;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (const T &t : v) {
    os << t << " ";
  }
  os << '\n';
  return os;
}
long long int dxx[] = {1, 1, 0, -1, -1, -1, 0, 1};
long long int dyy[] = {0, 1, 1, 1, 0, -1, -1, -1};
long long int dx[] = {1, 0, -1, 0};
long long int dy[] = {0, 1, 0, -1};
struct pll {
  long long int x, y;
};
bool comp(pll a, pll b) {
  if (a.x == b.x)
    return a.y < b.y;
  else
    return a.x < b.x;
}
void solve(long long int the) {
  char ch;
  double aa, bb, cc, dd, xx;
  string s1, s2, s3, s4, s5, str;
  long long int i, j, k, a, b, c, d, n, m, l, r, x, y, z, low, high, mid,
      sum = 0, ans = 0, temp, t;
  cin >> n;
  string s[2 * n - 2];
  bool ok;
  vector<string> v;
  c = 2 * n - 2;
  for (i = 0; i < c; i++) cin >> s[i];
  if (n == 2) {
    cout << "PS";
    return;
  }
  for (i = 0; i < 2 * n - 2; i++) {
    if (s[i].length() == n - 1) {
      v.push_back(s[i]);
    }
  }
  s1 = v[0];
  s2 = v[1];
  v.clear();
  for (i = 0; i < 2 * n - 2; i++) {
    if (s[i].length() == 1) {
      v.push_back(s[i]);
    }
  }
  s3 = v[0];
  s4 = v[1];
  v.clear();
  v.push_back(s1 + s3);
  v.push_back(s1 + s4);
  v.push_back(s2 + s3);
  v.push_back(s2 + s4);
  map<string, long long int> ma;
  for (t = 0; t < 4; t++) {
    ma.clear();
    str = v[t];
    x = 1;
    s3 = "";
    for (i = 0; i < c; i++) {
      a = 1;
      b = 1;
      l = s[i].length();
      s1 = s[i];
      for (j = 0; j < l; j++) {
        if (s1[j] != str[j]) a = 0;
      }
      high = n - 1;
      for (j = l - 1; j >= 0; j--) {
        if (s1[j] != str[high]) b = 0;
        high--;
      }
      if (a == 0 && b == 0)
        x = 0;
      else if (a == 1 && b == 0) {
        s3.push_back('P');
      } else if (a == 0 && b == 1) {
        s3.push_back('S');
      } else {
        if (ma[s1] == 0) {
          ma[s1] = 1;
          s3.push_back('P');
        } else {
          ma[s1] = 0;
          s3.push_back('S');
        }
      }
    }
    if (x == 1) {
      cout << s3 << endl;
      return;
    }
    reverse(str.begin(), str.end());
    x = 1;
    s3 = "";
    ma.clear();
    for (i = 0; i < c; i++) {
      a = 1;
      b = 1;
      l = s[i].length();
      s1 = s[i];
      for (j = 0; j < l; j++) {
        if (s1[j] != str[j]) a = 0;
      }
      high = n - 1;
      for (j = l - 1; j >= 0; j--) {
        if (s1[j] != str[high]) b = 0;
        high--;
      }
      if (a == 0 && b == 0)
        x = 0;
      else if (a == 1 && b == 0) {
        s3.push_back('P');
      } else if (a == 0 && b == 1) {
        s3.push_back('S');
      } else {
        if (ma[s1] == 0) {
          ma[s1] = 1;
          s3.push_back('P');
        } else {
          ma[s1] = 0;
          s3.push_back('S');
        }
      }
    }
    if (x == 1) {
      cout << s3 << endl;
      return;
    }
  }
}
int main() {
  long long int t = 1, c = 1;
  while (t--) {
    solve(c);
    c++;
  }
  return 0;
}
