def getStringForAndDifferential(a, b, c):
    """
    AND = valid(x,y,out) = (x and out) or (y and out) or (not out)
    """
    command = "(({0} & {2}) | ({1} & {2}) | (~{2}))".format(a, b, c)
    return command