Beyond the Rescue

아직 제출이 없습니다시간 제한3초메모리 제한256 MB

문제

Riatla is a little-known member of the Assassins Order (well-known assassins, as you can guess, don't live long). After performing one mission, Riatla faces a problem: the streets of the city are flooded by guards, and he needs a new escape plan from the crime scene.

The city where Riatla is at the moment has a tree-like structure. There are nn squares, connected with n1n-1 two-way streets, and there is only one path between every two squares.

Riatla's associates find out that the guards patrol the city in a cyclic route: they choose a sequence of squares v_1,v_2,,v_kv\_1, v\_2, \ldots, v\_k, and, after visiting square v_iv\_i, the guards head to square v_i+1v\_{i+1} (they may be not connected by a direct street, and then the guards go along the shortest path between them). After visiting square v_kv\_k, they go to square v_1v\_1, and start their route from the beginning.

Riatla is good at disguising. All the squares in the city are crowded, so the assassin can stay in a square without fear of being noticed by the guards even if the guards are on the same square. On the other hand, there are not many people on the streets, so if the assassin and the guards happen to be on the same street at any moment of time, the guards will shoot the assassin with bows regardless of the distance between them.

You know the plan of the city and how long it takes both the guards and the assassin to pass through every street. You should compute the minimal time that Riatla needs to spend to get from square ss, where he is now, to square tt, where his friends are waiting for him. As this time can be rather long, you only need to compute its remainder modulo 998,244,353998\\,244\\,353.

입력

On the first line of input, you are given one integer tt: the number of test cases. After that, tt test cases are given.

The first line of a test case description contains two integers nn and kk: the number of squares in the city and the number of important squares on the guards' path (2n,k200,0002 \le n, k \le 200\\,000).

Each of the next n1n-1 lines contains four integers u_iu\_i, v_iv\_i, c_ic\_i, and d_id\_i: the squares connected by streets and the times necessary for the guards and the assassin to walk through each street, respectively (1u_i,v_in1 \le u\_i, v\_i \le n; 1c_i,d_i1081 \le c\_i, d\_i \le 10^8). It is guaranteed that the given graph is a tree.

On the next line, you are given kk integers a_ia\_i: the indices of important squares in the guards' path in the order in which the guards visit them (1a_in1 \le a\_i \le n; a_ia_i+1a\_i \ne a\_{i+1}; a_1a_ka\_1 \ne a\_k).

On the next line, you are given two integers ss and tt: the starting square of the assassin and the last square of his path (1s,tn1 \le s, t \le n; sts \ne t).

It is guaranteed that both the sum of nn and the sum of kk in all the test cases don't exceed 200,000200\\,000.

출력

For each test case, print one number on a separate line: the minimal time the assassin has to spend, modulo 998,244,353998\\,244\\,353

If the assassin can't get to his target without being spotted, print 1-1.