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

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

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

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

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

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