Communication in employee hierarchy

A large transnational company is analyzing its organizational structure. One of the investigated phenomena is so called Hierarchy communication scheme.
The company is ruled by one general director. Each employee other than the general director has exatly one direct supervisor and any number of direct subordinates. General director has no direct supervisor. In the Hiearchy communication scheme, each employee exchanges information only with his/her direct supervisor or direct subordinate.
We define the communication distance between two employees A and B as the minimum number of employees involved in information exchange between A and B when the Hiearchy communication scheme is used. The communication distance includes both employees A and B. The communication is considered to be easy when all employees involved in the communication share the same mother language.

The company wants to know what is the maximum easy communication distance, i.e. what is the maximum communication distance for which all employees involved in the communication share the same mother language.



Image 1. Examples of employee hierarchies. Nodes correspond to employees, node colors correspond to particular mother languages. In case a) all employees mother languages are different, the maximum easy communication distance is thus 1. In case b) the maximum easy communication distance is 3 and there are 2 languages in which it is attained. In case c) the maximum easy communication distance is 4 and again there are 2 languages in which it is attained.

The task

You are given the hierarchy structure of the company and the mother language of each employee. You have to determine the maximum easy communication distance in the company and list all languages in which it is attained.


Input

The input text file describes the company hierarchy and the mother languages of the employees.
Each employee is represented in the format:

L (
 direct_subordinate_1
 direct_subordinate_2
 ...
 direct_subordinate_n
)
L is a positive integer which identifies the mother language of the employee.
The direct_subordinate_i field represents the i-th direct subordinate of the employee.
The indentation of any employee's direct subordinate is bigger by one space than the indentation of the employee.
The whole input is a representation of the general director, all other employees representations are defined by recursive application of the format rule described above (see also the examples).
Each value of L is restricted by the inequality 1 ≤ L ≤ 30. The number of employees does not exceed 4.1×106.

Output

The output consists of two text lines. The first line contains the number equal to the maximum easy communication distance in the company. The second line contains the identifiers of all languages in which the maximum easy communication distance is attained in the company. The identifiers are sorted in ascending order and are separated by spaces.

Example 1

Input
3 (
 2 (
 )
 1 (
 )
 4 (
 )
)

Output
1
1 2 3 4
The data of Example 1 are depicted in the Image 1 a).

Example 2

Input
5 (
 5 (
  3 (
  )
 )
 3 (
  3 (
  )
  3 (
  )
 )
 5 (
  2 (
  )
  4 (
  )
 )
)

Output
3
3 5
The data of Example 2 are depicted in the Image 1 b).

Public data

The public data set is intended for easier debugging and approximate program correctness checking. The public data set is stored also in the upload system and each time a student submits a solution it is run on the public dataset and the program output to stdout and stderr is available to him/her.
Link to public data set