1 s   128 MB

Description

문제 링크 (pdf)

Sample Output

4
3 1 2
1 3 2
5 3 4
3 1 2 4 5
6 1 6
2 1 3 4 5 6
7 7 7
1 7 2 3 4 5 6
BOTH
EASY
HARD
OKAY

Source

2013 ACPC (Arab Collegiate Programming Contest)