def get_possible_input_zs(vars, z_out, w):
    """ Find all the possible inputs for a block for a given output and w """
    v3, v4, v14 = vars
    possible_z_in = set()
    a = w - v3
    if 0 <= a < 26:
        possible_z_in.add(a + z_out * v14)
    x = z_out - w - v4
    if x % 26 == 0:
        possible_z_in.add(x // 26 * v14)

    print(f"     Possibles: vars={vars} z_out={z_out}, w={w}: {possible_z_in}")
    return possible_z_in