#D6913. iff
iff
iff
problem
There are propositions, named , respectively. Also, information about the propositions is given. The th information is "", which means that is . ("If" is a logical conditional and the transition law holds.) i $ Output all propositions that have the same value as i $ in ascending order. However, proposition and proposition are always the same value. Proposition and proposition have the same value as " X " and " if ".
output
On the line, output all propositions that have the same value as the proposition , separated by blanks in ascending order. Also, output a line break at the end of each line.
Example
Input
5 2 1 2 2 1
Output
1 2 1 2 3 4 5
inputFormat
outputFormat
Output all propositions that have the same value as i i i X Y if ". It means "Y X Y $".
output
On the line, output all propositions that have the same value as the proposition , separated by blanks in ascending order. Also, output a line break at the end of each line.
Example
Input
5 2 1 2 2 1
Output
1 2 1 2 3 4 5
样例
5 2
1 2
2 1
1 2
1 2
3
4
5
</p>