Bajtazar is about to change his marital status, and his loyal friends want to make his last days of freedom unforgettable.
Byteotia has n cities, numbered from 0 to n−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 p flight tickets. Each ticket allows a single flight, taken at any moment, from some city a to some city b (one way only, never from b back to a).
Bajtazar wants to start his journey in a fixed city s and finish it in a fixed city t. 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.
The first line contains the number of test cases T. Then T test cases follow, each in the form below.
The first line of a test case contains three integers n, m and p (2≤n≤100000, 1≤m≤1000000, 1≤p≤1000000): the number of cities, the number of open roads, and the number of flight tickets. The open roads always form a tree, so m=n−1.
The second line contains two integers s and t (0≤s,t≤n−1): the start city and the end city.
The next m lines describe the roads, one per line. Each road is given by two integers ai and bi (0≤ai,bi≤n−1, ai=bi), meaning there is a two-way road between cities ai and bi.
The next p lines describe the tickets, one per line. Each ticket is given by two integers ci and di (0≤ci,di≤n−1, ci=di), meaning Bajtazar owns a ticket for a flight from city ci to city di.
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.