CF1385E Directing Edges

Description

You are given a graph consisting of $ n $ vertices and $ m $ edges. It is not guaranteed that the given graph is connected. Some edges are already directed and you can't change their direction. Other edges are undirected and you have to choose some direction for all these edges. You have to direct undirected edges in such a way that the resulting graph is directed and acyclic (i.e. the graph with all edges directed and having no directed cycles). Note that you have to direct all undirected edges. You have to answer $ t $ independent test cases.

Input Format

N/A

Output Format

N/A

Explanation/Hint

Explanation of the second test case of the example: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1385E/d35669c68d98d1dcefc83e24fe388de76c760c1f.png) Explanation of the third test case of the example: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1385E/641ca4dc132da9f3a738d8606128481e262df751.png)