A string contains only the characters ()[]{}. It is valid if every opening bracket is closed by the same type of bracket, in the correct order.
()[]{}
Input: one string. Output: true if it is valid, otherwise false.
true
false
Your program reads from stdin and prints to stdout.
Example 1
Input: ()
Output: true
Hints