def epsilon_tensor_rank4(i, j, k, o):
    """Rank-4 epsilon tensor

    Extension of https://codegolf.stackexchange.com/a/160375
    """
    test_set = set((i, j, k, o))
    if not (test_set <= set((1, 2, 3, 4)) or test_set <= set((0, 1, 2, 3))):
        raise Exception("Unexpected input", i, j, k, o)

    return (i - j) * (j - k) * (k - i) * (i - o) * (j - o) * (o - k) / 12