def right_left_delaunay_condition(dim, p1, e1, p2, e2):
    """
    Delaunay condition for right-left pairs of triangles
    """
    e1m1 = (e1 + 2) % 3
    e2p1 = (e2 + 1) % 3
    im_e2p1 = 3 * (p2 + e2p1) + 1
    re_e2 = 3 * (p2 + e2)
    re_e1m1 = 3 * (p1 + e1m1)
    l = [0] * (dim + 1)
    l[re_e2 + 1] = 1
    l[re_e1m1 + 1] = 1
    l[im_e2p1 + 1] = -1
    return l
