Matrix: DFS-based longest skiing path