CF913E Logical Expression

Description

You are given a boolean function of three variables which is defined by its truth table. You need to find an expression of minimum length that equals to this function. The expression may consist of: - Operation AND ('&', ASCII code 38) - Operation OR ('|', ASCII code 124) - Operation NOT ('!', ASCII code 33) - Variables x, y and z (ASCII codes 120-122) - Parentheses ('(', ASCII code 40, and ')', ASCII code 41) If more than one expression of minimum length exists, you should find the lexicographically smallest one. Operations have standard priority. NOT has the highest priority, then AND goes, and OR has the lowest priority. The expression should satisfy the following grammar: E ::= E '|' T | T T ::= T '&' F | F F ::= '!' F | '(' E ')' | 'x' | 'y' | 'z'

Input Format

N/A

Output Format

N/A

Explanation/Hint

The truth table for the second function: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF913E/c3830892a1af029262c7cea8f026f08f9802d2de.png)