7689 - PD - Ordersssss   

Description

給你一些變數之間的條件限制(以 x

Input

每組測試資料2列,第1列為所有的變數名字。變數皆為小寫的英文字母。
第2列為變數的條件限制,每個條件限制包含2個變數 x y。
代表 x

請參考Sample Input。

Output

對每一組測試資料,輸出所有符合條件的變數排列,每個一列,且各排列之間按字典順序排序。
測試資料間請輸出一空白列,請參考Sample Output。

Sample Input  Download

Sample Output  Download

Tags




Discuss