def xor(a, b):
    return a^b

def and2(a, b):
    return a&b

def and3(a, b, c):
    return a&b&c

def and4(a, b, c, d):
    return a&b&c&d

def or2(a, b):
    return a|b

def or3(a, b, c):
    return a|b|c

def or4(a, b, c, d):
    return a|b|c|d

def no(a):
    return a^1