Let S:[[5,1],[4,2],[3,5],[2,3],[1,4]] I need a function f, such that sort(S,f) get [[1,4],[4,2],[2,3],[3,5],[5,1]]