| 
| Идёт турнир! |  | В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания. 
 |  
 | 
| imesecan | 28.мая.2016 в 11:27:58 |  |  | 0 | No, the output of Sample Input 2 is ok. 
 
 |  | sreka | 28.мая.2016 в 12:04:46 |  |  | 1 | Test 1 Input: 
 5
 7
 3 1 2 4
 3 3 4 5
 4 1 2 3 4
 4 1 3 4 5
 2 3 4
 4 2 3 4 5
 3 1 3 5
 
 Pattern:
 
 1
 3
 5
 
 
 |  | sreka | 28.мая.2016 в 12:09:48 |  |  | 2 | Sample Input 2 Explanation: In the first day, 1, 3, 5, 4 learn a new topic (X).
 In the second day, 5 teaches to 6 topic X.
 In the third day, 6 teaches to 7 and 8 topic X.
 In the fourth day, 6 teaches to 2 topic X.
 In the fifth day, 2, 6, 8, 1 learn a new topic (Y).
 
 The students who know topic X and Y are 1, 2, 6, 8.
 
 
 |  | imesecan | 28.мая.2016 в 13:03:34 |  |  | 3 | Test 2 Input: 
 10
 14
 2 1 7
 2 4 8
 2 1 9
 2 4 6
 2 1 8
 4 2 5 6 10
 4 1 2 3 5
 2 7 9
 2 1 9
 7 1 3 4 5 6 8 9
 2 7 10
 4 5 6 8 9
 2 7 9
 5 2 4 7 8 10
 
 Pattern:
 1
 2
 4
 5
 6
 7
 8
 9
 10
 
 
 |  
 |