Sort the sides to simplify required tests