P13852 [CodeChef] qcj2
NOI
题目描述

There is a war going on between two countries and the enemy of your country depends heavily on the transportation of Weapons between two strategic points A and B. Point A and point B along with other points (C,D, etc... ) are connected by a network of roads. Disrupting all traffic between points A and B will give your country sufficient time to gather valuable resources. Since your country has only one bomb left you can only destroy one road. Your Mission should you choose to accept it is to identify all roads that may be destroyed in order to restrict all traffic between the points A and B. The Enemy has nearly destroyed us and hence if we are to win this war then finding that road is critical.

Input
In the input each point is identified by a single upper-case alphabet ( maximum of 26 ).Each line of input identifies a pair of points connected by a road. Input ends with the line containing the string "END" (quotes for clarity). All roads are bi-directional and more over there is at most one road between any two points.

Output
Output all roads such that blowing any one of them will halt all traffic between points A and B. Note that the roads should be sorted according to order in which they are listed in the input (Check sample test case).
If no such road exists then output should be "Too Bad, We Lose" (quotes for clarity).

Example

Input:
AC
AD
AE
CE
CF
ED
GF
BG
HB
GH
END

Output:
CF
GF

输入格式

见题面

输出格式

见题面

样例输入
AC AD AE CE CF ED GF BG HB GH END
样例输出
CF GF