SP12244 NATALIAS - Natalia Has Another Problem

Description

Natalia has another problem she needs your help with. Do you still have some energies left? A _Logical String_ is a string that represents a valid boolean expression. It is composed of operators AND, OR and NOT and truth values operands. The boolean expressions are recursive in the sense that operators can have other operators as operands. For example, the following is a list of valid _Logical Strings_: T T F F AND(T, T) OR(T, F) NOT(T) AND(OR(T, F), AND(F, F)) AND(AND(AND(OR(T, F), F), F), T) AND ( AND ( OR ( T,F),OR(F,F)),T) Please note that there can be several spaces in between objects. However, no space will be in between letters of the names. Therefore, "AND(T,T)" is a valid _Logical String_ but "A N D(T,T)" is not. Given a _Logical String_, please evaluate it and output its truth value.

Input Format

The first line contains T(1Logical String is valid.

Output Format

For each _Logical String_ given, output its truth value. If it is true, output T, otherwise output F.