python solution to routarded