P3465 [POI 2008] CLO-Toll

Description

King Byteasar has yielded under pressure of Byteotian merchants and hence decided to settle the issue of toll paid by them. Byteotia consists of $n$ towns connected with $m$ bidirectional roads. Each road connects directly two different towns and no two towns are connected by more than one direct road. Note that the roads may lead through tunnels or flyovers. Until now each town in Byteotia imposed duty on everyone who either entered or left the town. The merchants, discontented with such situation, lodged a protest against multiple taxation. King Byteasar ruled that the town privileges are now restricted. According to the new royal edict, each town can only charge toll on merchants travelling by exact one road leading into the town, regardless of the direction they are travelling in. Furthermore, for each road, those who travel it cannot be made to pay the duty to both towns the road connects. It remains to determine which town should collect toll from which road. Solving this problem His Highness has commissioned to you. ## Task Write a programme that: - reads the Byteotian road system's description from the standard input, - for each town determines on which road it should impose toll, or claims it is impossible, - writes out the result to the standard output.

Input Format

N/A

Output Format

N/A

Explanation/Hint

样例1: ![](https://cdn.luogu.com.cn/upload/pic/6984.png) 样例2: ![](https://cdn.luogu.com.cn/upload/pic/6985.png)