killjee has a string of parentheses containing '(',')','[',']','{','}' . Following are the rules to determine a valid parentheses string:
Example of some valid String:- ([]{}){}[] , ()(){}[] , ({[()]}) Example of some invalid String:- ({)}[] , ((}}} , ({)[]}
INPUT
First line of input contain a single integer t denoting number of testcases.
Each test contains a string s containing '(',')','[',']','{','}'
OUTPUT
For each test case, Output "YES" if string is valid else print "NO".
CONSTRAINTS