time limit per test: 0.25 sec. memory limit per test: 4096 KB
input: standard output: standard
There is a syntactically correct boolean expression. The definition of syntactically correct expression follows as: 1) "a","b","c",...,"j" are syntactically correct expressions. 2) If A is a correct expression, then !A and (A) are correct expressions too. 3) If A is a correct expression and B is a correct expression, then A||B, A&B, A<=>B, A=>B, A#B are syntactically correct expressions too. Syntactically correct expression doesn't contain spaces. Small Latin letters are variables, ! denotes negation, || - disjunction, & - conjunction, <=> - equality, => - implication, # - excepting or. Negation has the highest priority, conjunction has middle priority, and other operations have low priority. Brackets change the order of operations executing. Two expressions are called identical if their values are the same in any values of variables. Make the expression, which will be identical with given expression. New expression must be free of brackets.
Single line of input contains the correct expression; its length does not exceed 2048 symbols. Variables are denoted by small Latin letters from 'a' to 'j'.
In the first line of output write the sought for expression. Its length must not exceed 32768 symbols.
Saratov ST team Spring Contest #1
Codeforces (c) Copyright 2010-2019 Mike Mirzayanov