Help in modified shortest path

the above question asks us to find shortest path that has max sum of coordinates.how do we store different path weights at the same time.