def gen(symbol, s1, s2, s3):
    """
    Generate one quaternary formula.

    :param symbol: Mask object
    :param s1: Mask object
    :param s2: Mask object
    :param s3: Mask object
    """
    result = '(' + symbol.outer
    for s in [s1, s2, s3]:
        result += ','
        if len(s.outer) == 0:
            result += '_'
        else:
            result += s.inner
    result += ')'
    return result