eolymp
bolt
Try our new interface for solving problems
Problems

Brackets

Brackets

Time limit 1 second
Memory limit 64 MiB

The sequence of n opening and closing parentheses are given. You have k queries for changing a single bracket to opposite (the opening bracket changes to closing and otherwise). After each query you must answer does the current sequence of brackets is correct.

The bracket sequence is called correct if the number of opening brackets equals to the number of closing, and in any prefix of the sequence the number of opening brackets is no less then number of closing brackets.

Input data

The first line contains n (1n100 000) parentheses. The second line contains the number of queries k (1k100 000). Each of the next k lines contains one number p (0p < n) - the bracket number that must be changed to opposite.

Output data

Print k lines. In each line print either '+' or '' depending on the correctness of the current bracket sequence after executing the current query.

Examples

Input example #1
()
5
0
0
1
1
0

Output example #1
-
+
-
+
-