Dr. Hon is an extraordinary researcher in indexing. As the best programmers of his students, you are given a task to help his research. First, you should have some basic knowledge of what his reaching area.
Given a string T with N characters, we define “suffixes” of T as the strings “start at every possible character, and ends until T ends”. For example, for T=”NTHU-ZZ”, all suffixes of S are:
S1=”NTHU_ZZ”,
S2=”THU_ZZ”,
S3=”HU_ZZ”,
S4=”U_ZZ”,
S5=”_ZZ”,
S6=”ZZ”,
S7=”Z”,
S8=””.
We can compare every 2 suffixes in lexical order. For example, S3<S2 because ‘H’<’T’. If suffix Si ends earlier before Sj while comparing, Si is smaller. For example, S7<S6 and S8 is the smallest suffix.
For a string T, we will transform it to another string T’, which composed of also N characters, either ‘S’ or ‘L’. If Si<Si+1, the ith character of T’ is ‘S’; if Si>Si+1, the ith character of T’ is ‘L’.
Given a string T, your task is to answer what the corresponding T’ is.
There are several cases. Each case contains one line of string, the string is composed of the character set {A~Z, a~z, 0~9, _ }, so there will be no any spaces in the input.
The end of input will be a line contains only 1 character ‘#’.
Each case will not exceed 100,000 characters, and there will be no more than 100 cases.
For each case T, output the T’ in a line.