CF843D Dynamic Shortest Path

Description

You are given a weighted directed graph, consisting of $ n $ vertices and $ m $ edges. You should answer $ q $ queries of two types: - 1 v — find the length of shortest path from vertex $ 1 $ to vertex $ v $ . - 2 c $ l_{1}\ l_{2}\ ...\ l_{c} $ — add $ 1 $ to weights of edges with indices $ l_{1},l_{2},...,l_{c} $ .

Input Format

N/A

Output Format

N/A

Explanation/Hint

The description of changes of the graph in the first sample case: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF843D/24bd98e5125f858d47fdfa77b158c3a581ad248b.png) The description of changes of the graph in the second sample case: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF843D/d325c1b90420a99987b13a59d8addca767eb6927.png)