The program reads from standard input an expression. Only brackets are of interest: round (), square [], and curly {}. All other characters are ignored.
The expression has balanced brackets if:
- every opening bracket has a matching closing bracket of the same type, later in the string;
- brackets do not interleave: the last opened bracket is the first to be closed.
For example, ([]{}) and {[()]} are balanced, but ([)] is not.