Given a directed graph and many queries C, decide for each C whether 1 can reach C and C can reach N.
Medium6GraphDFSBFSImplementationNo attempts yetTime limit2sMemory limit256 MBIn the year 2544, 527 years from now, humanity can travel between stars. Looking for a new home outside the solar system, people build the CTP (Cho Technology Planet), a planet packed with advanced technology. The CTP is run by an artificial intelligence, has no natural disasters and no wars, and many people live there happily.
The CTP has N cities, numbered from 1 to N. Cities are connected by very fast tubes. Because of their speed, tubes are one-way: a tube from city A to city B does not mean there is a tube from city B to city A. Travel inside a tube is so fast that the travel time is negligible, however far apart the two cities are.
One day the space-class villain Jaeunis invades, and the CTP, everyone's utopia, faces the worst crisis since it was built. Jaeunis plants an antimatter bomb powerful enough to destroy the whole CTP in one of the N cities and disappears. To save the CTP, the bomb has to be sent into a black hole through the interstellar transporter in city N. The bomb only needs to be moved from its city to city N, but it is too heavy for ordinary people. Only the superhero Mino, who is in city 1, can carry it.
If Mino can travel from city 1 to the city with the bomb and then carry the bomb to city N, the CTP is saved. Mino may use the same tube more than once and may visit a city again. There is no limit on the length of the route.
Can the superhero Mino save the CTP? The input contains T scenarios. Each scenario gives the number of the city where Jaeunis planted the bomb. Write a program that determines, for each scenario, whether Mino can defend the CTP.
The first line contains the number of cities N (3≤N≤100000) and the number of tubes M (1≤M≤1000000).
Each of the next M lines contains two integers X and Y (1≤X,Y≤N), meaning there is a tube from city X to city Y.
The next line contains the number of scenarios T (1≤T≤100000). Each of the following T lines contains C (2≤C≤N−1), the number of the city where Jaeunis planted the antimatter bomb.
The input and output are large, so fast I/O is recommended.
Print T lines, one per scenario. Print Defend the CTP if Mino can save the CTP, and Destroyed the CTP if there is no way to save it. Do not print the quotation marks.
The figure below shows two different scenarios on a CTP with N=6.

Figure (a) is the scenario where the bomb is in city 5. Mino follows the tubes marked in red from city 1 to city 5, then carries the bomb to city 6 and saves the CTP. Figure (b) is the case where the bomb is in city 2. Mino can reach city 2 along the red tubes, but there is no way from city 2 to city 6, so the villain Jaeunis destroys the CTP.