CF1092C Prefixes and Suffixes

题目描述

Ivan挑了几个长度为$n$的小写英文字符串。 但是你不知道Ivan挑的是什么字符串。Ivan会给你这些字符串的前缀和后缀,但是你不知道哪个是前缀,哪个是后缀。 你的任务是猜出他给你的$2n-2$个字符串中哪个是前缀,哪个是后缀。猜出他挑的任意一个字符串,并且回答与之一致即可通过。 PS:在Ivan给你的某个字符串中,如果前面有一个与之相同并且你判了它为$P$,那么你只能判它为$S$。

输入格式

第1行是所猜字符串的长度$n$。 接下来$2n-2$行是Ivang给你的前缀或后缀。 数据保证:一定有2个长度为$1,2,...,n-1$的字符串。

输出格式

输出一个长度为$2n-2$的字符串。第$i$个字符表示你对第$i$个前缀或后缀的判断。 第$i$个字符是$P$,说明你判断其为前缀;若是$S$,说明你判断其为后缀。

说明/提示

The only string which Ivan can guess in the first example is "ababa". The only string which Ivan can guess in the second example is "aaa". Answers "SPSP", "SSPP" and "PSPS" are also acceptable. In the third example Ivan can guess the string "ac" or the string "ca". The answer "SP" is also acceptable.