Enter Dunty

0

0 votes
Problem

Bunty got tired of playing with Chunty and decided to play with Dunty. Dunty usually plays badminton but since neither of them had any rackets they decided to play with brackets. They initially start with a non empty balanced bracket string S.

balanced bracket string is a string consisting of only brackets, such that this sequence, when inserted certain numbers and mathematical operations, gives a valid mathematical expression. Formally you can define balanced bracket sequence with:

  • e (the empty string) is a balanced bracket sequence.
  • if s is a balanced bracket sequence, then so is (s).
  • if s and t are balanced bracket sequences, then so is st.

For instance (())()(())() is a balanced bracket sequence, but ())(())( is not.

Bunty and Dunty play alternatively. In each turn, each player has to choose any non empty balanced bracket substring of S such that it is not a concatenation of more than one balanced bracket string. eg: some valid examples of substrings are (()()), (()), (), (((()))), (()(())()()) whereas invalid examples include ((, )), ()(()) {as it is a concatenation of 2 balanced bracket strings}. The first player unable to move loses the game.

Bunty is tired of being a loser and decides to go first or second based on whether he can win no matter what moves the other person plays assuming Bunty plays optimally.

Given S, print if Bunty should go first or second.

Input Format

First-line has T, number of test cases.

Each of the T lines contain a single string S

Output Format

Print "First" or "Second" based on whether Bunty must go first or second on a new line for each test case.

Constraints

1T101|S|103

S is a balanced bracket string

Sample Input
2
()
()()
Sample Output
First
Second
Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

In the first case the first player can remove the entire string and win the game.

In the second case no matter what the first person plays the second person can remove the rest of the string and win. Hence, Bunty goes second.

Editor Image

?