Let the four directions are along X and Y axis
North = +Y aixs
South = - Y axis
East = + X axis
West = - X axis
So displacements are given as
South
North
South
North
Now total displacement towards north is 5km + 2 km = 7 km
Now total displacement towards south is 5km + 4 km = 9 km
Now the net displacement of whole journey will be
d = 9 - 7 = 2 km towards SOUTH