This page is still under construction.

Parts of this page are still being built. What you see may change.

George Boole

Interview

Time limit2sMemory limit512 MB

Summary
Read one boolean operation in the form true AND false and print its result.
Level

Easy1 of 10

Topics
Implementation, String, Math, Bit manipulation
Solved
No attempts yet

Problem

George Boole was an English mathematician, educator and philosopher, born in 1815. He was the first professor of mathematics at Queen's College, Cork (now University College Cork, UCC), and he is known as the inventor of boolean arithmetic, the field that today's computers are built on.

Boolean arithmetic has no infinite supply of numbers. It has exactly two values: 0 and 1, true and false, yes and no. This problem uses true and false. The two most common operations in boolean arithmetic are AND and OR.

An AND operation gives true only when both values are true.

  • true AND true = true
  • true AND false = false
  • false AND false = false

An OR operation gives true when at least one of the values is true.

  • true OR true = true
  • false OR false = false
  • false OR true = true

Read one such operation and print the correct result.

Input

Read a single line from standard input. The line contains three words in the format value1 operation value2.

Both value1 and value2 are either true or false. The field operation is either AND or OR.

Output

Print the result of the operation, either true or false, on one line.

Examples6

  1. Example 1

    Input
    true AND true
    
    Expected output
    true
    
  2. Example 2

    Input
    true OR true
    
    Expected output
    true
    
  3. Example 3

    Input
    true AND false
    
    Expected output
    false
    
  4. Example 4

    Input
    false OR true
    
    Expected output
    true
    
  5. Example 5

    Input
    false AND false
    
    Expected output
    false
    
  6. Example 6

    Input
    false OR false
    
    Expected output
    false