#P7786. Tokitsukaze, CSL and Palindrome Game

Tokitsukaze, CSL and Palindrome Game

Tokitsukaze, CSL and Palindrome Game

Problem Description

Tokitsukaze is playing with CSL a game based on a string S1..nS_{1..n} which only contains lowercase letters and whose length is nn. A string is palindromic if and only if it reads the same backward as forward, such as "madam" and "racecar". Before the game starts, Tokitsukaze will select a palindromic substring of SS, denoted as Sa..bS_{a..b}, and CSL will select a palindromic substring, denoted as Sc..dS_{c..d}, too. There is also a string PP that is empty at the beginning of the game. Then at every second, a character will be appended to the end of PP automatically, where the character is randomly chosen from all possible lowercase letters (i.e. 'a' to 'z'), each with the same probability 126\frac{1}{26}. The game ends when both Sa..bS_{a..b} and Sc..dS_{c..d} become substrings of PP. Let E(Sa..b)E(S_{a..b}) be the expected length of PP when Sa..bS_{a..b} firstly becomes a substring of PP, and E(Sc..d)E(S_{c..d}) be the similar expected value for Sc..dS_{c..d}. The winner of the game will be the one with a lower expected value for his or her choice. In case of a tie, when E(Sa..b)E(S_{a..b}) equals to E(Sc..d)E(S_{c..d}), the game is a draw. Now, they will play this game with the same string SS for qq times, and Tokitsukaze will inform you of their choices in each game. Can you predict for her the result of each game?

Input

There are several test cases. The first line contains an integer TT (1T25)(1 \leq T \leq 25), denoting the number of test cases. Then follow all the test cases. For each test case, the first line contains an integer nn (1n105)(1 \leq n \leq 10^5), denoting the length of the string SS. The second line contains the string SS consisting of only lowercase letters. The third line contains an integer qq (1q105)(1 \leq q \leq 10^5), denoting the number of games. In the next qq lines, each line contains four integers aa, bb, cc and dd (1abn,1cdn)(1 \leq a \leq b \leq n, 1 \leq c \leq d \leq n), representing a game where Tokitsukaze selects Sa..bS_{a..b} and CSL selects Sc..dS_{c..d}.

Output

For each game, output in one line "sjfnb" (without quotes, the same below) if Tokitsukaze will be the winner, or "cslnb" if CSL will, or "draw" in case of a tie. Note that the output characters are case-sensitive.

Sample Input

1
7
abbabba
5
1 1 2 2
1 4 4 7
2 3 1 7
1 4 5 6
2 3 3 5

Sample Output

draw
draw
sjfnb
cslnb
sjfnb

Source

2020 Multi-University Training Contest 3