Repeat 3 times
Sub events -
Local variable "highestValue"
Local variable "index"
Array for each xy
Array.cury=1
Array. Curvalue>highestValue
-> Set index to array.Curx
-> Set highestValue to array.Curvalue
Next same-level event, not sub-
->Push back Array2 array.At(index,0)
->Set Array2 at Array2.width-1,1 to array.at(index,1)
->Delete array at index
If you need to preserve the original array, you can save array.asjson to a variable beforehand and load it again after.