A city subway line has become huge and it is hard to take the shortest path through them. You have to find the shortest path in subway lines. In the second 0, you are in the station start and you want to go to the station end.
The city has n stations. The subway has m lines. Each subway line goes to some stations.
The i−th subway goes to stations ui,1,ui,2,ui,3,...,ui,ki(in order) and this train takes wi,j seconds to travel from ui,j to ui,j+1(for 1≤i≤m and 1≤j<ki).
Trains are ready for the passengers to get in, but the last train goes in the second ti(and you are allowed to board it in between the path).
Input
The first line contains n,m(in order).
Next 3∗m lines describe subway lines.
The first line contains ki,ti and next line contains ui,1,ui,2,ui,3,...,ui,kiand the next line contains w1,w2,...,wki−1.
The last line containts start,end.
It is guaranteed start≠end and no subway line intersects itself.
Output
Print the shortest path in subway lines from the station start to end.
If there is no way from start to end, print -1.
Constraints
1≤n,m≤100 000
1≤ui,j≤n
2≤ki
k1+k2+...+km≤100 000
0≤ti≤109
1≤wi,j≤109
In second 0 get on first subway line and in next second we arrive to station 2 and we can get on second line and arrive to 4 in second 2