def check_perm(tri1,tri2):
    """
    Check that these permutations (representing by their triplets) 
    are compatible, i.e. don't contain a common triplet.
    """
    for t1 in tri1:
        for t2 in tri2:
            if t1 == t2:
                return False
    return True