You are standing at position . From position , you can walk to or with cost . From position , you can travel to without any cost to ( is a permutation of numbers ). You have to reach position . Determine the minimum possible cost.
Input format
Output format
Print the minimum possible cost.
-