expression = raw_input("Enter a boolean expression in 2 variables, p and q:")

print "p         q            "  + expression
length = len("p         q            "  + expression)+2
print length*"-"

p = True
q = True
print "" + str(p) + "     " + str(q) + "      " + str(eval(expression))

p = True
q = False
print "" + str(p) + "     " + str(q) + "     " + str(eval(expression))

p = False
q = True
print "" + str(p) + "    " + str(q) + "      " + str(eval(expression))

p = False
q = False
print "" + str(p) + "    " + str(q) + "     " + str(eval(expression))

