Bachelor Party

No attempts yetTime limit1sMemory limit128 MB

Problem

Bajtazar is about to change his marital status, and his loyal friends want to make his last days of freedom unforgettable.

Byteotia has nn cities, numbered from 00 to n1n-1. Some pairs of cities are joined by a two-way road, but most roads are under repair. Exactly enough roads remain so that between every pair of cities there is exactly one route made of roads. In other words, the open roads form a tree.

Bajtazar's friends have also bought pp flight tickets. Each ticket allows a single flight, taken at any moment, from some city aa to some city bb (one way only, never from bb back to aa).

Bajtazar wants to start his journey in a fixed city ss and finish it in a fixed city tt. Along the way he may use any roads and must use all of his tickets, in any order he likes. Unfortunately, once he leaves a city he can never return to it, so no city may be visited more than once during the whole trip.

Decide whether a journey satisfying all of these conditions exists.

Input

The first line contains the number of test cases TT. Then TT test cases follow, each in the form below.

The first line of a test case contains three integers nn, mm and pp (2n1000002 \le n \le 100\,000, 1m10000001 \le m \le 1\,000\,000, 1p10000001 \le p \le 1\,000\,000): the number of cities, the number of open roads, and the number of flight tickets. The open roads always form a tree, so m=n1m = n - 1.

The second line contains two integers ss and tt (0s,tn10 \le s, t \le n-1): the start city and the end city.

The next mm lines describe the roads, one per line. Each road is given by two integers aia_i and bib_i (0ai,bin10 \le a_i, b_i \le n-1, aibia_i \ne b_i), meaning there is a two-way road between cities aia_i and bib_i.

The next pp lines describe the tickets, one per line. Each ticket is given by two integers cic_i and did_i (0ci,din10 \le c_i, d_i \le n-1, cidic_i \ne d_i), meaning Bajtazar owns a ticket for a flight from city cic_i to city did_i.

Output

For each test case print a single line containing the word TAK if the journey Bajtazar wants can be arranged, or NIE if it is impossible. Here TAK means yes and NIE means no.