Sorting – Sort the data as indicated

Consider the data

data = {{x1, y1, z1}, {x2, y2, z2}, {x3, y3, z3}, {x4, y4, z4}, {x5, y5, z5}, {x6, y6, z6} , ...}

with N rows.

It can be divided into N / 3 sets of 3 rows. I would like to sort the data so that the rows inside each set are aligned according to the growth parameter of y. Finally, if yi = yj, then the top row must be the one for which xi> xj.

For example, if y2> y1> y3 and y6> y5 = y4 and x4> x5, then it is necessary that

datasorted = {{x2, y2, z2}, {x1, y1, z1}, {x3, y3, z3}, {x6, y6, z6}, {x4, y4, z4}, {x5, y5, z5} , ...}

Could you please tell me how to do that?