One day, Little Gyro was playing with a series of Bracket Sequences, A Bracket Sequence is a string that only contains two kinds of characters '(' and ')'. Let us define a regular Bracket Sequence in the following way:
- Empty sequence is a regular sequence.
- If S is a regular sequence, then (S) is also a regular sequence.
- If A and B are regular sequences, then A+B (the character '+' means splice the sequence A and B) is a regular sequence.
For example, all of the following sequences of characters are regular Bracket Sequences: (), (());
And all of the following character sequences are not: (, ), )(, ())), ((();
After randomly picking a Bracket Sequence from the series, Little Gyro was currently studying whether the selected Bracket Sequence is regular or not. While Little Gyro was carefully investigating the sequence, the naughty boy Onlystar came and changed some brackets at several specific positions. For each operation, the left bracket '(' will be replaced to the right bracket ')', and the right bracket ')' will be replaced to the left bracket '(' as well. All the operations will not alter the length of the whole Bracket Sequence.
It was really annoying that Little Gyro had to calculate the whole Bracket Sequence again and again. However, the troublemaker Onlystar thought that it was very funny.
Now Little Gyro send this task to you, after each step of Onlystar's operation, please tell Little Gyro whether the current Bracket Sequence is regular or not. Please help him.