You are given locations array, which are (x,y) on a graph, that represent servers. And directions array, which are values 1-4, that represent the directions a request is routed. When 1 is (x,y)->(x+Z,y+Z), 2 is (x,y)->(x+Z,y-Z), 3 is (x,y)->(x-Z,y+Z) and 4 is (x,y)->(x-Z,y-Z). You need to start from locations[0], and route the request by following the direction steps. In each step, you need to route the request to the closest unvisited server. If there is no such, skip to the next step. Return the location at the end.